Parameters and Variables

Within the shell, a shell parameter is associated with a value that is accessible to the user. There are several kinds of shell parameters. Parameters whose names consist of letters, digits, and underscores are often referred to as shell variables, or simply variables. A variable name must start with a letter or underscore, not with a number. Thus A76, MY_CAT, and _ _ _ X _ _ _ are valid variable names, whereas 69TH_STREET (starts with a digit) and MY-NAME (contains a hyphen) are not. Shell variables that you can name and assign values to are user-created variables. One convention is to use only uppercase letters for names of global variables (environment variables) and to use mixed-case or lowercase letters for other ...

Get A Practical Guide to Red Hat® Linux® 8 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.