[nylug-talk] need sed help

Ah Pook ahpook at verizon.net
Wed Apr 4 16:50:16 EDT 2007


On Wednesday 04 April 2007 3:45 pm, Steven Lembark wrote:
> Peter C. Norton wrote:
> > On Wed, Apr 04, 2007 at 03:22:08PM -0400, Steven Lembark wrote:
> >> Why not use perl:
> >>
> >>   perl -p -e 's/^\s+//' in.txt > out.txt;
> >
> > That's going to work on more than just the first line. Eg. it is
> > wrong.
>
> Oops, forgot to slurp the thing:
>
>   perl -p -e 'BEGIN{ undef $/ } s/^\s+//' in.txt > out.txt;

perl -i -pe 's/^\s+// if $.==1' thing.txt


More information about the nylug-talk mailing list