Dies schrieb Jim Meyering ([email protected]): > > 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 ;-)
