[英]Bash script 'if' statement that calls a function with parameters
我想要在我的bash脚本中执行以下if语句:
if [[ "$v" == "A" || my_func $x $y ]] ; then
但出现错误“预期条件二进制运算符”。 我已经尝试在对my_func的调用中的参数周围加上引号,但是仍然没有好处。 尝试玩eval,但也无济于事。
谢谢你的帮助。
你可以试试:
if [[ "$v" == "A" ]] || my_func $x $y ; then
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.