Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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.


Comment on Re^2: Bash for loop variable pass equivalent in perl
Download Code

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 pondering the Monastery: (10)
As of 2015-07-31 05:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls