When a variable is first used you assign it a value with an equals sign like this:
myvariable="Hello"When you want to access the variable, put a dollar sign in front of it:
echo $myvariable
HelloThere are also built-in variables like:
For example, to find your home directory, you can type echo $HOME, or use it in a script. The following line will download the source code from the URL http://www.example.com/ and save it to the Desktop of the current user:
lynx -source "http://www.example.com/" > $HOME/Desktop/example.html
Did you find this post helpful? Leave a comment below, and subscribe to my RSS feed.