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.
In reply to Re^2: Bash for loop variable pass equivalent in perl
by aaron_baugher
in thread Bash for loop variable pass equivalent in perl
by ZWcarp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |