如果下面应该返回 true,但它实际上失败,并在 bash shell 中执行时报告参数过多的错误。我想我遵循了所有带双引号的准则,但无法弄清楚为什么它在我的生活中失败了......有什么想法吗?
#!/usr/bin/bash
# These are the values in the environment
#echo ">"$PS_APP_HOME"<" => >/app/psoft/app_85909<
#echo ">"PS_CUST_HOME"<" => >/app/psoft/cust_85909<
#echo ">"$(pwd)"<" => >/app/psoft/app_85909<
if [ "$(pwd)" != "$PS_APP_HOME" ] -o [ "$(pwd)" != "$PS_CUST_HOME" ]
Run Code Online (Sandbox Code Playgroud) bash ×1