当前位置: 技术问答>linux和unix
while read的关于读取最后一行的问题
来源: 互联网 发布时间:2017-03-01
本文导语: 以下脚本, #!/bin/bash USER="cca" servers_filename="/eaa/cca/st_scripts/src/servers_cc.txt" output_file="/eaa/cca/st_scripts/deletelogs/deletelog_cc.log" date > $output_file echo "deleting logs for servers in $servers_filename ... " while read SERVER do ...
以下脚本,
#!/bin/bash
USER="cca"
servers_filename="/eaa/cca/st_scripts/src/servers_cc.txt"
output_file="/eaa/cca/st_scripts/deletelogs/deletelog_cc.log"
date > $output_file
echo "deleting logs for servers in $servers_filename ... "
while read SERVER
do
echo "$SERVER : deleting logs ..."
done
#!/bin/bash
USER="cca"
servers_filename="/eaa/cca/st_scripts/src/servers_cc.txt"
output_file="/eaa/cca/st_scripts/deletelogs/deletelog_cc.log"
date > $output_file
echo "deleting logs for servers in $servers_filename ... "
while read SERVER
do
echo "$SERVER : deleting logs ..."
done