Please Help me “binary operator expected in cygwin”

强颜欢笑 提交于 2020-01-03 05:28:06

问题


I am trying to Run Shell script in Cygwin but I am getting Following error msgs:

app.sh: line 215: clear: command not found [: scripts/Test: binary operator expected. The folder scripts/Test ID Not found...

Can Any one suggest. What is the problem Do i need to re install Cygwin again.

Because Same Script Running fine in the Linux Envirnment.

Thanks in Advance.....


回答1:


the script is probably using '#!/bin/sh' but expects the behaviour of /bin/bash. Try executing the script as: /bin/bash shell_script.sh

debugging tools include executing the script with the -x option, i.e. bash -x shell_script.sh. The problem from the outset looks like an unset variable that is being checked using the unprotected form:

if [ $x = ]

the problem is that if $x is unset, then you end up with an empty token, which causes the script to fail.

for the explicit 'clear' command not found, the cygwin implementation of that is to call 'tput clear' if you replace the 'clear' call with 'tput clear' then it should work.



来源:https://stackoverflow.com/questions/8340144/please-help-me-binary-operator-expected-in-cygwin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!