bash: syntax error near unexpected token '('
您需要转义括号:
mv hiscore\(pre_mame0133u1\).dat /mnt/three/usr/local/share/xmame/hiscore.dat
笔记:
为了将来参考,您可以使用ShellCheck在您的bash代码中查找错误。输入未更正的脚本将给出以下信息:
$ shellcheck myscript
Line 1:
mv hiscore(pre_mame0133u1).dat /mnt/three/usr/local/share/xmame/hiscore.dat
^-- SC2148: Tips depend on target shell and yours is unknown. Add a shebang.
^-- SC1036: '(' is invalid here. Did you forget to escape it?
^-- SC1088: Parsing stopped here. Invalid use of parentheses?
更正第一个错误:
$ shellcheck myscript
Line 1:
mv hiscore\(pre_mame0133u1).dat /mnt/three/usr/local/share/xmame/hiscore.dat
^-- SC2148: Tips depend on target shell and yours is unknown. Add a shebang.
^-- SC1089: Parsing stopped here. Is this keyword correctly matched up?
并更正第二个错误:
$ shellcheck myscript
Line 1:
mv hiscore\(pre_mame0133u1\).dat /mnt/three/usr/local/share/xmame/hiscore.dat
^-- SC2148: Tips depend on target shell and yours is unknown. Add a shebang.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句