bash - Shell Error no such file or directory BUT USED PWD -
why not working please ! why pwd in code not working , both scripts in same file here code :
check_process() { echo "$ts: checking $1" [ "$1" = "" ] && return 0 [ `pgrep -n $1` ] && return 1 || return 0 } parent_path=$( pwd ) while [ 1 ]; # timestamp ts=`date +%t` echo "$ts: begin checking..." check_process "slimerancher" [ $? -eq 0 ] && echo "$ts: not running" [ $? -eq 1 ] && echo "$ts: running" && 'bash $parent_path+"/.forcequit.sh"' sleep 5 done
pwd
not problem; single-quoting string should left unquoted.
[ $? -eq 1 ] && echo "..." && bash "$parent_path"/.forcequit.sh
Comments
Post a Comment