printf question

can you take input from another command and do printf?

such as

awk '{print $2,$1}' | sort -k1,1 -k2,2 | printf "%-10s,%15s"

this does not work.. but there must be a way.. please help me..
thank you.

I guess I can do this,

echo yahoo never | while read a b; do printf "%-10s %-20s" $a $b ; done

can someone tell me if there is another way to do this?

can you use xargs wd multiple argument?

printf "%-10s,%15s\n" $( awk '{print $2,$1}' filename | sort -k1,1 -k2,2 )

ah.... nice.. thanks :slight_smile: