|
发表于 2005-12-24 06:05:41
|
显示全部楼层
Post by 河边星星
cat /tmp/erpnot1 | while read kuser
do
kyn=0
cat /tmp/allowerp2 | while read allowuser
do
if [ "$kuser" == "$allowuser" ] ; then
kyn=1
fi
done
if [ "$kyn" == "0" ]; then
echo $kuser
fi
done
为了什么变数只能在当前的do done中有效呢?
因为Pipe。所有的pipe被认为subshell. 如果你写成for或是while do; done <(input)的形式,就不会这样了。 |
|