2009/3/13 Toby Stuart <toby.stu...@figtreesys.com.au>

> Hello All
>
> It's been almost 13 years since I last posted on this board and my Perl
> skills are extremely rusty.  Could someone help me to convert this to a one
> liner:-
>
>
> use strict;
> use warnings;
>
> while (<>) {
>  /^##\s*(.*)$/ && print $1;
>  print " && " unless eof;
> }
>
> try this:
perl -n -w -e'/^##\s*(.*)$/ && print $1.((eof)?"":" && ")' tmp.txt




>
>
> Input file looks like this:-
>
> ## sudo apt-key adv --recv-keys --keyserver 
> keyserver.ubuntu.comABF3B2646E619416
> ## sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com1024R/43CBFCC0
>
>
>
>
> PS.  Where is $Bill?  Is he still around?
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

Reply via email to