Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Bash for loop variable pass equivalent in perl

by aaron_baugher (Curate)
on Aug 10, 2012 at 18:06 UTC ( #986793=note: print w/ replies, xml ) Need Help??


in reply to Re: Bash for loop variable pass equivalent in perl
in thread Bash for loop variable pass equivalent in perl

And to get perl's default line-by-line behavior in the shell, set IFS to a newline (The ctrl-V ctrl-J sequence inserts a raw newline into the command without ending it):

$ IFS="^V^J "; for i in `cat file`; do echo aaa $i; done

Aaron B.
Available for small or large Perl jobs; see my home node.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://986793]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2016-08-26 06:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (366 votes). Check out past polls.