Hello, I am new to Sun Solaris. I like it so far but I am having problems with some of my bash scripts.
I am trying to run a backup script which does a system call and stores that value into a variable. If I run this command in the shell it works perfectly fine. But if I put the same command in a shell script it gives me an error. The following commands work just fine in my shell scripts on my red hat and debian servers.
LIST="$(ncftpls -u vivek -p mypassword ftp://array05.wan.nixcraft.com/vivek/
DAY=$(date +" %a" )
If I run them at the terminal window they store the proper value in teh variable if I echo it. But if i put it in a script it gives me an error like below:
bash-3.00# sh FTP_BACKUP_SCRIPT_v1.2.sh
syntax error at line 8: `NOW=$' unexpected
Any idea why? Is processed differently on Sun Solaris and if so how can i fix this. Thanks!