change field separator in bash

 % for i in $(cat testbla); do echo $i; done
foo
bar
baz
boo
 
% export IFS=$'\n'
 
% for i in $(cat testbla); do echo $i; done
foo bar
baz boo

Leave a Reply