[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coreutils] [PATCH] head: optionally indicate underrun of set limit
From: |
Stefan Tomanek |
Subject: |
Re: [coreutils] [PATCH] head: optionally indicate underrun of set limit |
Date: |
Tue, 23 Nov 2010 18:31:20 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Dies schrieb Jim Meyering (address@hidden):
> > This does seem useful on the face of it.
> > I need to do a little further investigation
> > to see if there are existing ways to achieve the same.
>
> For the record, here's a quick one-liner:
>
> $ seq 2|perl -ne '$n=3; print; $.==$n and $ok=1,last; END{exit 4*!!$ok}'
> 1
> 2
> $ seq 5|perl -ne '$n=3; print; $.==$n and $ok=1,last; END{exit 4*!!$ok}'
> 1
> 2
> 3
Sure, I'm using perl myself to achieve this, but using perl for any problem
would render most common utilities useless ;-)