xargs vs awk
so i tend to do this a lot:
so i found i can do this:
so i can do this:
is there a simpler solution?
[command to grab output] | awk '{print $1}' | xargsto get a list of space seperated items. this is fine but something always niggles at me that i should just do this with awk. ;)
so i found i can do this:
[command to grab output] | awk '{printf $1" "this is fine but it doesn't add a new line at the end.
so i can do this:
[command to grab output] | awk '{printf $1" "} END {print ""}'so i have what i want... but now xargs is still shorter!
is there a simpler solution?
Comments