码迷,mamicode.com
首页 > 系统相关 > 详细

shell中的while read用法

时间:2015-03-17 09:00:29      阅读:251      评论:0      收藏:0      [点我收藏+]

标签:

#!/bin/sh
path_monitor=/opt/monitor_process.sh
path_process_list=/opt/process.list
cat $path_process_list | while read i
do
        if [ x"$(ps -Af | grep "$i" | grep -v grep)" = x"" ] ; then
                $i &
        fi
done

shell中的while read用法

标签:

原文地址:http://www.cnblogs.com/mycats/p/4343491.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!