Environment variables script
From Initq
In this script we will also use [ or test to check if a file exists.
#!/bin/sh if [ -f try_var.sh ] then salutation="Hello" echo $salutation echo "The program $0 is now running" echo "The second parameter is $2" echo "The first parameter is $1" echo "The parameter list was $*" echo "The users home directory is $HOME" echo "Please enter a new greeting" read salutation echo $salutation echo "The script is now complete" fi exit 0 $ ./try_var.sh bus khlas Hello The program ./try_var.sh is now running The second parameter is khlas The first parameter is bus The parameter list was bus khlas The users home directory is /home/lexiana Please enter a new greeting olaf olaf The script is now complete