Bash: Syntax error near unexpected token `('

From FVue
Jump to: navigation, search


A shell script is generating this error message:

$ cat
$ bash line 1: syntax error near unexpected token `(' line 1: ` ((CNT++))'


It appears the space before the command `((CNT++))' isn't an ordinary space 0x20 but a non-breaking space 0xA0. This can be viewed in vim with the command: ga

Replace the non-breaking space with a regular space and execution goes all right:

$ cat
$ bash 


blog comments powered by Disqus