Comment Comment by BiteCode_dev Agreed.In fact, anybody promoting cut, please give me the cut version of: echo -e "foo bar baz" | choose -1 -2 It should work on an arbitrary number of spaces, and fields.The oneliner is going to be... interesting.Now you can do it with awk using: echo -e "foo bar baz" | awk '{ print $NF " " $(NF-1)}' But it's neither easy to type, nor to remember.Choose is what cut should have been. parent BiteCode_dev 6 years ago
In fact, anybody promoting cut, please give me the cut version of:
It should work on an arbitrary number of spaces, and fields.The oneliner is going to be... interesting.
Now you can do it with awk using:
But it's neither easy to type, nor to remember.Choose is what cut should have been.