shell 读取文件的每一行内容并输出


(1)
#!/bin/bash

while read line
do
    echo $line
done < file


(2)
#!/bin/bash

cat file  | while read line
do
    echo $line
done



(3)
for line in `cat file`
do
    echo $line
done

相关文章

Centos系统之Shell编程基础知识
从Export理解Shell环境和变量生存期
linux shell数组变量、类型及规则
Centos编程Shell基本工作原理方案
Centos操作系统编程之Shell 问答录
rsync-linux备份脚本