every developer should know sed and awk. it is amazing how many devs write cumbersome scripts or little programs to handle tasks that are built for sed and awk.
my ~/bin folder has ~50 different little scripts that handle all sorts of small tasks.
my ~/bin folder has ~50 different little scripts that handle all sorts of small tasks.
awk -F, '{print $3}' foo | xargs -I{} echo 'command -x -y -z {}'
perl -e 'open F, "<foo"; while(<F>) { my($a,$b,$c,@rest) =split /,/; system("command -x -y -z $c"); }'
I think I could do the split into an array and then take the third element, but I'm just trying to do an elementary example. When you want to do more things to this argument you necessarily have to grow this, and at one point I got to the point where I started having to escape quotes. That's rather difficult to read when you're just trying to do something quick in the command line and you mismatch a pair.
perl -lane 'system("command -x -y -z $F[2]")' foo