[root @localhost~]# cat mycontent.txt
This is a sample file
We are going through contents
line by line
to understand
创建一个名为“ example1.sh”的脚本,该脚本使用输入重定向和循环:
[root @localhost~]# cat example1.sh
#!/bin/bash
whileread rows
do
echo "Line contents are : $rows "
done < mycontent.txt
运行结果: