in reply to Yet another one-liner
Why use -n and not -p here?:
perl -i.bak -pe 'print "\n" if($.==1)'or in the Perl Golf spirit:
perl -i.bak -pe 's/^/\n/ if($.==1)'Update:Darn! fundflow is right! So let's try:
perl -i.bak -pe 's/^/\n/ if(!$a); $a= !eof'This one should work fine
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Yet another one-liner
by fundflow (Chaplain) on Jan 12, 2001 at 00:58 UTC | |
by tye (Sage) on Jan 12, 2001 at 01:03 UTC |