Hacker News new | ask | show | jobs
by PaulHoule 468 days ago
awk

(It's a guilty pleasure to write shell pipelines that use awk to write a shell script and then pipe that script in sh, I find it easier than looking up the bizzaro syntax for loops in bash in the info pages.)

1 comments

> use awk to write a shell script

Do you have any examples of this?

How about

    ls -l *.txt | awk '{if ($5<2000) print "cat " $9}' | sh
to cat text files that are less than 2000 bytes long