将某一行存储下来

#!/bin/sh
# ipcs> ipcs.log
#cat ipcs.log|grep 68

 if [ ! -f "ipcs.log" ]; then
 echo "ipcs.log not exist! ............"
 fi
 while true

 do
 ipcs> ipcs.log
 #cat ipcs.log
 mm=$(cat ipcs.log|grep 68|awk '{print $6}')
 if [ $mm -ne 0 ];then
 echo ${mm} >> tmp
 fi
 sleep 1
 done

发布了9 篇原创文章 · 获赞 1 · 访问量 6696

猜你喜欢

转载自blog.csdn.net/u014426028/article/details/102939050