Shell 错误没有这样的文件或目录但已使用 PWD
Shell Error no such file or directory BUT USED PWD
为什么这不起作用请帮忙!
为什么代码中的密码不起作用,两个脚本都在同一个文件中
这是代码:
check_process() {
echo "$ts: checking "
[ "" = "" ] && return 0
[ `pgrep -n ` ] && 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
pwd
不是你的问题;你是 single-quoting 一个应该不加引号的字符串。
[ $? -eq 1 ] && echo "..." && bash "$parent_path"/.forcequit.sh
为什么这不起作用请帮忙! 为什么代码中的密码不起作用,两个脚本都在同一个文件中 这是代码:
check_process() {
echo "$ts: checking "
[ "" = "" ] && return 0
[ `pgrep -n ` ] && 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
pwd
不是你的问题;你是 single-quoting 一个应该不加引号的字符串。
[ $? -eq 1 ] && echo "..." && bash "$parent_path"/.forcequit.sh