Let's consider a BASH shell script named example.sh that contains a variable named HW that contains the text Hello World.
#!/bin/bash HW="Hello World"
There will be no output when issuing the echo $hw command.
[user1@server1 ~]# echo $hw
The source command is used to tell your shell to use your example.sh script. Instead of using the word source, just a single period can be used as well.
[user1@server1 ~]# source example.sh [user1@server1 ~]# . example.sh
Now, echo $hw will produce Hello World.
[user1@server1 ~]# echo $hw Hello World