Why is this not working please help ! Why is the pwd in the code not working , both scripts are in the same file Here is the code :
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