Using Shell Variables

Variables are temporary placeholders for information, either numbers or sequences of characters (called strings). The system (that is, the shell) has a number of useful predefined variables, such as the user name, home directory, and system name. Using the env command generates a listing of all persistent environment variables (meaning that they don't stop existing when the current command or script ends, instead they exist for your Linux login environment as a whole) defined in your shell. Listing 21.3 is the output generated by the env command on my machine. This will vary somewhat from machine to machine, of course.

Code Listing 21.3. Sample Output Listing of the env Command
 [jwalter@jansmachine samples_22]$ env USERNAME= ...

Get Practical Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.