Bash, awk et al = the syntax that can't be remembered, not even when smashed in the head with a tiring iron or forced with a submachine gun.
I think the confusing factor with awk is that it allows you to leave out variuos levels of structure in the really simple scripts, meaning that the same scripts you see around will look quite different.
E.g. all the following would be the same (looking for the string "something" in column 1, and printing only those lines):
'$1 == "somestring"'
'$1 == "something" { print }'
'($1 == "something")'
'($1 == "something") { print }'
... to give a small example.
At least this confused me a lot in the beginning.
awk '{print $3}'
is what cut should have been all along. Specifically, this will give you the third space delimited field, where multiple spaces are coalesced. cut -d ' ' -f 3
will get you whatever is between the 3rd and 4th space.[1]: https://brendaneich.com/2010/07/a-brief-history-of-javascrip...
Awk + bash could easily recreate most existing code in a couple of lines