Writing a bash script, I got an error when trying to run it :
syntax error near unexpected token `(' declare -a
My array was declared was :
declare -a persons = ('person1' 'person2')
Even though my code looks correct and nice ;) , Unix don't accept it. I was removing the quotes.... but nothing worked.
And finally I find the solution: In fact we shouldn't put any space between = and (.
declare -a persons=('person1' 'person2')
syntax error near unexpected token `(' declare -a
My array was declared was :
declare -a persons = ('person1' 'person2')
Even though my code looks correct and nice ;) , Unix don't accept it. I was removing the quotes.... but nothing worked.
And finally I find the solution: In fact we shouldn't put any space between = and (.
declare -a persons=('person1' 'person2')
ça ressemble aux fautes de mes étudiants loooool toujours les espaces
ReplyDeleteEh bah oui, lorsqu'on est habitue au java, on ne pense pas que les espaces peuvent causer des problemes :D
Delete