なぜこれが機能しないのですか?助けてください!コードの 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