I have been searching everywhere for an answer to this question. I have an array in my shell script, but when I run it, I get this error: "(" unexpected
What am I doing wrong here:
array=( 1 2 3 4 5 )
I am using Ubuntu 11.10
You are running your script with /bin/sh
, not /bin/bash
. There are no arrays in sh
.
choroba@cyan ~$ /bin/sh
$ a=( 1 2 3 )
/bin/sh: Syntax error: "(" unexpected
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With