shell中的while read用法

#!/bin/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

posted @ 2015-03-17 08:42  调皮的猫  阅读(4281)  评论(0编辑  收藏  举报