3 ms·
> You don't explain what line's "--column" option does It was simply the equivalent of Awk printing columns like this. awk '{ print $2, $3, $4 }' Except with
by pipeline_peak 5y ago
> You don't explain what line's "--column" option does
It was simply the equivalent of Awk printing columns like this.
awk '{ print $2, $3, $4 }'
Except with support for column ranges, which I don't think Awk supports without writing a for loop.
Something convoluted like :
awk -v start=1 -v end=3 '{ for (i=start; i<=end;i++) printf("%s%s",
$i,(i==end) ? "\n" : OFS) }' marks.txt
Idk, the amount of Unix that GNU and BSD accepted as a bare environment, the range is single purpose programs like tail and mini interpreters which are powerful but require a lot of skill. If I worked in system administration, and I HAD to use shell, I'd hold onto Awk for dear life. But I don't, so it's sort of this ancient swiss army knife.