1825775 Members
2287 Online
109687 Solutions
New Discussion

Re: perl -ne

 
Vanquish
Occasional Advisor

perl -ne

Hi
I have used perl -ne in ksh
it does not prints in orignal
format, i want to print it in
orignal format.
thanks
3 REPLIES 3
Rodney Hills
Honored Contributor

Re: perl -ne

perl -pe defaults to printing each line. Kind of depends on what your mean by "original format".

-- Rod Hills
There be dragons...
Vanquish
Occasional Advisor

Re: perl -ne

sorry
for being vague
i am using
perl -ne 'print unless /^but it does not prints in orignal format
what it reads from. I mean to say each line as it is.
Thanks
Rodney Hills
Honored Contributor

Re: perl -ne

If I have a file that has-
abc
defgh
ij
klmn

Then read this with perl -ne 'print', I get-
abc
defgh
ij
klmn

It maintains the orginal format...

--Rod Hills
There be dragons...