|
Re: New tool for textutils: msg#00114gnu.core-utils.bugs
Antonio Diaz <ant_diaz@xxxxxxxxxxx> wrote: > I agree it is perhaps not worth to have another program for such a > task, but I think it should be not too dificult to add that > functionality to the program "cut". Sorry, but it would not be appropriate to add such functionality to cut. ... > I like much more "The software tools philosophy" than the "learn a new > programming languaje for every task philosophy". And possibly many of > the GNU users that aren't sysadmins agree with this. > > The Perl motto is "There's more than one way to do it". Well, my way > is not to use it. :) (Of course my way can't be appropiate for > everybody). We don't need Perl for this. Just use grep (or sed or g/awk): >> -M, --max-length=<n> remove lines longer than <n> > > perl -ne 'my $x = $_; chomp; length > 100 or print $x' > perl -ne 'my $x = $_; chomp; print $x if length <= 100' grep -E '^.{0,100}$' >> -m, --min-length=<n> remove lines shorter than <n> > > perl -ne 'my $x = $_; chomp; length < 100 or print $x' > perl -ne 'my $x = $_; chomp; print $x if length >= 100' grep -E '^.{100}' |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: New tool for textutils: 00114, Antonio Diaz |
|---|---|
| Next by Date: | coreutils-4.5.12 build feedback: 00114, Nelson H. F. Beebe |
| Previous by Thread: | Re: New tool for textutilsi: 00114, Antonio Diaz |
| Next by Thread: | Re: New tool for textutils: 00114, Paul Eggert |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |