use IFS in bash
function dfd() { #http://www.cnblogs.com/hunterfu/archive/2010/02/23/1672129.html IFS=$'\n' for i in $(lsd);do du -sh "$i"; done }
#!/bin/bash IFS_old=$IFS #将原IFS值保存,以便用完后恢复 IFS=$’\n’ #更改IFS值为$’\n’ for line in `cat file.txt` do echo $line done