我在import脚本中加入count=ps x |grep "excall"|grep -c "import.sh"if [ $count -gt 1 ]thenecho "have"$countexit -1fi这一段 用于判断我在其他目录运行的时候是否有其他import再使用,但次次都count都是2,这事什么原因导致的呢。具体设置到什么原理呢?求解
ps x |grep "excall"|grep -c "import.sh"
再加一个不匹配自身
grep -v "grep"