bash: syntax error near unexpected token '('
Vous devez échapper aux crochets:
mv hiscore\(pre_mame0133u1\).dat /mnt/three/usr/local/share/xmame/hiscore.dat
Remarque:
Pour référence future, vous pouvez utiliser ShellCheck pour rechercher des bogues dans votre code bash. La saisie du script non corrigé donne les informations suivantes:
$ 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?
Corriger la première erreur:
$ 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?
Et en corrigeant la deuxième erreur:
$ 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.
Lectures complémentaires
ls -l
et voyez si c'est là ...cd Downloads
mv Downloads\hiscore\(pre_mame0133u1\).dat /mnt/three/usr/local/share/xmame/hiscore.dat