3 ms·
echo '999 888' | cut -f2 -d " " # notice two consecutive spaces returns NULL.
by Eduard 1y ago
echo '999 888' | cut -f2 -d " " # notice two consecutive spaces
returns NULL.
- cluckindan 1y agoRight, that would be expected though? I suppose awk is better for parsing formatted (padded) output.
- xorcist 1y agoThere are invalid column separators for awk too. To handle consecutive spaces in cut you have squeeze them: echo '999 888' | tr -s " " | cut -f2 -d " "