Bash script - array of strings? -
i'm new bash script coding, i've put want reboot services on server (in case crash)
however, i'm hitting stumbling block @ basic point:
#!/bin/bash declare -a arr=(tomcat7 nginx mysql);
...gives error:
script-checks.sh: 3: script-checks.sh: syntax error: "(" unexpected
i've tried quoted well:
declare -a arr=("tomcat7" "nginx" "mysql");
i don't understand why i'm getting error though. looks i'm using correct syntax:
http://www.thegeekstuff.com/2010/06/bash-array-tutorial/
please advise (i'm coming perl background, quite different me - appologies if i've missing stupid!)
your script not run bash
. suppose uses sh
.
Comments
Post a Comment