網路城邦
上一篇 回創作列表 下一篇   字體:
linux script if string
2022/04/13 15:58:31瀏覽77|回應0|推薦0
#!/bin/sh
echo 111
[ "`whoami`" = "root" ] || echo "err"
[ "`whoami`" = "root" ] || exit 0
echo 222
= = =
#! /bin/sh
st1=`mount | grep "/dev/sdc1 on /media/box5"`
if [ -z "$st1" ];then 
echo "err"
exit 1 
fi
echo ok
exit 1
( 創作其他 )
回應 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=greatcat&aid=173296766