For example, if I get a string like
a b c d
where the spaces among the fields are not decided.
How to get the four fields a, b, c and d out?
Here, we take getting ‘b’ (the 2nd field) as the example.
tr -s ' ' | cut -d ' ' -f 2
Another way is to use