当前位置: 技术问答>linux和unix
一个shell脚本的问题
来源: 互联网 发布时间:2016-04-10
本文导语: #!/bin/sh NodeID=08 ls *.txt > srcfilelist while read file do timetag="`date '+%Y%m%d%H%M%S'`" filename=SMS-(${NodeID})-${timetag}.TXT awk -F "," '{if($2!="63"&&$13=="0" && $16=="0") print $5 "," $8 "," $11 "," $45}' ${file} >${filename} done
#!/bin/sh
NodeID=08
ls *.txt > srcfilelist
while read file
do
timetag="`date '+%Y%m%d%H%M%S'`"
filename=SMS-(${NodeID})-${timetag}.TXT
awk -F "," '{if($2!="63"&&$13=="0" && $16=="0") print $5 "," $8 "," $11 "," $45}' ${file} >${filename}
done
NodeID=08
ls *.txt > srcfilelist
while read file
do
timetag="`date '+%Y%m%d%H%M%S'`"
filename=SMS-(${NodeID})-${timetag}.TXT
awk -F "," '{if($2!="63"&&$13=="0" && $16=="0") print $5 "," $8 "," $11 "," $45}' ${file} >${filename}
done