bash – awk if then else snippet
A clear example of the if/then/else structure formatting in awk. 123456789$ awk ‘ BEGIN { FS="," ; FORMAT="%-10s%-8s%s\n" ; {printf FORMAT,"A","B","% age"} } { … Read More
A clear example of the if/then/else structure formatting in awk. 123456789$ awk ‘ BEGIN { FS="," ; FORMAT="%-10s%-8s%s\n" ; {printf FORMAT,"A","B","% age"} } { … Read More
Coloring text in columns of output of awk. 12echo "line 1 line 2" | awk ‘/line/ {print "\033[32m" $1 "\033[31m" $2 }’ results in: line1 line2 Color is given by … Read More