- Learning Linux Shell Scripting
- Ganesh Naik
- 228字
- 2021-06-25 22:02:55
Working with environment variables
Environmental variables are inherited by any subshells or child processes, for example, HOME, PATH. Every shell Terminal has a memory area called the environment. Shell keeps all details and settings in the environment. When we start a new Terminal or shell, this environment is created every time.
We can view the environment variables with the following command:
$ env
Or we can use this:
$ printenv
The output of the $ env command is as follows:
The list of environment variables will be quite extensive. I advise you to browse through the complete list. We can change the content of any of these environment variables.
Environmental variables are defined in a Terminal or shell. They will be available in any subshells or child shells created from the current shell Terminal. You will learn about these activities in the next few sections. You have already learned that every command in a shell creates a new subshell from the current shell.
The following is a brief summary of a few environmental variables:

Whenever any user logs in, the /etc/profile shell script is executed.
For every user, the .bash_profile Shell script is stored in the home folder. The complete path or location is /home/user_name/.profile.
Whenever a new Terminal is created, every new Terminal will execute script .bashrc, which is located in the home folder of every user.
- Dreamweaver CS3+Flash CS3+Fireworks CS3創意網站構建實例詳解
- Splunk 7 Essentials(Third Edition)
- 網絡服務器架設(Windows Server+Linux Server)
- Java實用組件集
- Visual Basic從初學到精通
- 精通特征工程
- Windows 7寶典
- Storm應用實踐:實時事務處理之策略
- 內模控制及其應用
- Chef:Powerful Infrastructure Automation
- 電腦上網輕松入門
- 計算機組網技術
- 自動化生產線安裝與調試(三菱FX系列)(第二版)
- Visual Studio 2010 (C#) Windows數據庫項目開發
- Mastering Geospatial Analysis with Python