while ; for
while true;do ... done ; cat filename |while line;do...done ; while read line;do...done<./filename
for i in nums;do ... done
注意:for 在逐行的读文件时是以空格做分隔符的, 如 aaa bbb 同行会扫出两个元素
while read LINE
doecho "begin to restore file " $LINEext3grep /dev/vgdata/LogVol00 --restore-file $LINEif [ $? != 0 ]thenecho "restore failed, exit"# exit 1fidone < ./mysqltbname.txt