为什么这不起作用请帮助!为什么代码中的 pwd 不起作用,两个脚本都在同一个文件中 这是代码:
check_process() {
echo "$ts: checking $1"
[ "$1" = "" ] && return 0
[ `pgrep -n $1` ] && return 1 || return 0
}
parent_path=$( pwd )
while [ 1 ]; do
# timestamp
ts=`date +%T`
echo "$ts: begin checking..."
check_process "SlimeRancher"
[ $? -eq 0 ] && echo "$ts: not running"
[ $? -eq 1 ] && echo "$ts: it is running" && 'bash $parent_path+"/.forcequit.sh"'
sleep 5
done