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)