CIS 3355 Lecture Notes - Lecture 11: Shell Script, Child Process, Environment Variable

18 views3 pages

Document Summary

Global environment variables: are visible from the shell session, and any child. Local environment variables: are only available in the shell that creates them. Linux sets several global environment variables when a user starts a bash session. The system environment variables use all capital letters to differentiate them from normal user environment variables. To view the global environment variables, use the printenv command: $ printenv. To display the value of an individual environment variable, use the echo command. When referencing an environment variable, place a dollar sign before the environment variable name: Global environment variables are also available to child processes running under the current shell session: The set command displays all of the environment variables set for a specific process, including the global environment variables. Setting local environment variables: once you start a bash shell (or spawn a shell script), you can create local variables that are visible within your shell process.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents