#!/bin/sh HOST='ftp.mistonline.in' USER='' PASSWD='' FILE='file.txt' ftp -n $HOST << END quote USER $USER quote PASS $PASSWDcd databackup/DB/ put $FILE quit END exit 0 The Tricks Getting the password to the ftp server without having the ftp client program read the password from /dev/tty requires two tricks: Using the -n option on the ftp client... (Continue reading)
Create a small shell script, testVar2.sh: testVar2.sh #!/bin/sh echo “testVar is: $testVar” testVar=”my shell script” echo “testVar is: $testVar” Now run the script: $ ./testVar2.sh testVar is: testVar is: my shell script testVar hasn’t been set to any value, so it’s blank. Then we give it a value, and it... (Continue reading)
Here is a simple shell script to start with, #!/bin/sh MY_MESSAGE="Hello World" echo $MY_MESSAGE This assigns the string “Hello World” to the variable MY_MESSAGE then echoes out the value of the variable. Note that we need the quotes around the string Hello World. Whereas we... (Continue reading)