3 ms·
deleting (i.e) not printing lines Here are the examples for not printing the 4th line: sed: sed -n '4!p' awk: awk 'NR != 4' perl: perl -ne '$. != 4 && print'
by emmelaich 12y ago
deleting (i.e) not printing lines
Here are the examples for not printing the 4th line:
sed: sed -n '4!p'
awk: awk 'NR != 4'
perl: perl -ne '$. != 4 && print'
Not much between them really.
- scdlbx 12y agoI would consider 'sed 4d' to be significantly easier than doing the same in Perl, but I don't disagree that it's not that hard to do in either.