获得一个"暧昧重定向"错误 [英] Getting an "ambiguous redirect" error
本文介绍了获得一个"暧昧重定向"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的Bash脚本以下行
The following line in my Bash script
echo $AAAA" "$DDDD" "$MOL_TAG >> ${OUPUT_RESULTS}
给我这个错误:
line 46: ${OUPUT_RESULTS}: ambiguous redirect
为什么?
推荐答案
Bash可以是pretty钝的时候。
Bash can be pretty obtuse sometimes.
下列命令所有基本相同的错误返回不同的错误消息:
The following commands all return different error messages for basically the same error:
$ echo hello >
bash: syntax error near unexpected token `newline`
$ echo hello > ${NONEXISTENT}
bash: ${NONEXISTENT}: ambiguous redirect
$ echo hello > "${NONEXISTENT}"
bash: : No such file or directory
周围的变量加上引号似乎是对付暧昧重定向消息的好方法:你往往会得到当你犯了一个错误输入一个更好的消息 - 和当错误是由于在文件名空间,使用引号是该修补程序。
这篇关于获得一个"暧昧重定向"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文