2 ms·
If your issue with cut is what I susect, you need to flatten the whitespace first with sed. At that point, I'd just use awk, though. It has better defaults for
by silentbicycle 17y ago
If your issue with cut is what I susect, you need to flatten the whitespace first with sed.
At that point, I'd just use awk, though. It has better defaults for field delimiters.
- jsrn 17y ago> [...] you need to flatten the whitespace first with sed by "flatten the whitespace" do you mean turning many spaces into one space? If so, I have always used tr with the -s (squeeze) option for that: $ echo "one two three" | tr -s " " | cut -d " " -f 3 three
- silentbicycle 17y agoDidn't know about that option, I always did it with sed. Thanks! :)