Understanding Programming Variables
Sometimes, it’s necessary to define variables to use in your scripts. You can define, view, and unset these variables as needed for your programming needs. Note that although the system will allow you to create programming variable names with all upper-case letters, it’s considered bad form to do so. Best practice is to always name your programming variables with lower-case letters, so that you won’t risk accidentally overwriting the value of an environmental variable with the same name. (Of course, you won’t cause any long-term damage by overwriting an environmental variable. But, why risk overwriting an environmental variable that you might need to use later in your script?)
To show how this all works, let’s create some programming variables from the command-line, and view the assigned values. First, we’ll create the car
variable and assign to it the value Ford
, like this:
[donnie@fedora ~]$ car...