shell按行读取文件的3种方法
#!/bin/bash #set -x for line in `cat /root/shizonghao/1.sh` do echo $line done
#!/bin/bash while read line do echo $line done < cat /root/shizonghao/1.sh
#!/bin/bash cat /root/shizonghao/1.sh | while read line do echo $line done
shell按行读取文件的3种方法
#!/bin/bash #set -x for line in `cat /root/shizonghao/1.sh` do echo $line done
#!/bin/bash while read line do echo $line done < cat /root/shizonghao/1.sh
#!/bin/bash cat /root/shizonghao/1.sh | while read line do echo $line done