while循环脚本
shell脚本实现linux系统命令cat读文件的基本功能
[root@localhost shell]# cat while-daemon.sh
while read line
do
echo $line
done<$1
[root@localhost shell]# bash while-daemon.sh /etc/passwd
[root@localhost shell]# bash while-daemon.sh /etc/hosts
while循环脚本
shell脚本实现linux系统命令cat读文件的基本功能
[root@localhost shell]# cat while-daemon.sh
while read line
do
echo $line
done<$1
[root@localhost shell]# bash while-daemon.sh /etc/passwd
[root@localhost shell]# bash while-daemon.sh /etc/hosts