Earlier quoted context omitted.
If you just use awk for `{ print $2 }` then I would still prefer `tr -s ' ' | cut -d ' ' -f2`, since both are part of coreutils and with `awk` you would add a additional dependency to your script.
that is not equivalent because awk will remove trailing/leading space/tab/newlines (newlines come into play with a different record separator) whereas, tr will still leave a trailing/leading space for example: $ echo ' a b c ' | tr -s ' ' | cut -d ' ' -f2 a $ echo ' a b c ' | awk '{print $2}' b and by default awk splits on space/tab/newlines, whereas in cut example above, you get only space as delimiter cut has its u…
It possible to use `xargs -L 1` to trim the separators, but then you would also add `findutils` as deps.
I just wanted to point out that keeping the dependencies of scripts in mind when programming is also important.