How to add \n for perl one liner
Hello everyone,
I thank you in advance your input. I can run this perl one line statement Code:
[user@server ~]# perl -le 'print (1 .. 10);' I get a blank output Code:
[user@server ~]# perl -e '$twenty = (1 .. 20); print "$twenty\n";' Code:
[user@server ~]# perl -e 'print (1 .. 20); . "\n";' |
Code:
perl -e '$\="\n"; print (1 .. 10);' |
Keefaz, thank you for your input. I'm just getting into Perl and couldn't get past this question.
|
While going through the examples you might check the meaning of the run time options, too. It should be in the manual page "perlrun"
Code:
man perlrun Code:
perl -pi.old -e 's/\bfoo\b/bar/g' *.txt |
All times are GMT -5. The time now is 09:07 PM. |