$ FIVE=5
$ echo $FIVE
5
$ echo "The number five is $FIVE"
A shell script will launch a new shell that has a fresh scope.
$ FIVE = 5
$ vim myshellscript.sh
#!/bin/bash
echo $FIVE
$ ./myshellscript.sh
Blank because the executed script doesn't affect the current shell. To make something affect the current shell, use the source command.
Use the export command to change the scope of your variable to global for your shell.
To make a permanent global variable, add it to your .bash_profile like so:
MY_NAME=breck; export MY_NAME
Use the read command to accept input.
echo "What is 1+1?"
read ANSWER
echo "Your answer is $ANSWER"