Thursday, November 29, 2007

Bash shell IFS Internal Field Separator setting and unsetting

When using your "for i in " and you want your "i" to contain
the whole lines instead of space separated fields use the below
at the begining and at the end of your shell script:


export OFS="$IFS" ; export IFS=$'\n';
[ SHELL SCRIPT HERE THAT WORKS on WHOLE LINES ]
export IFS="$OFS"

No comments: