Home System Tutorial LINUX There are three types of variable classifications of environment variables in Shell.

There are three types of variable classifications of environment variables in Shell.

Mar 21, 2024 am 08:00 AM
environment variables shell

Unixshell variable classification

There are three types of variables in the Shell: internal variables, environment variables, and user variables.

Internal variables: provided by the system, no need to define linux modification of user environment variablesGetting started with linux, cannot be changed

Environment variables: The system provides linux to modify user environment variables. You don’t need to define Linux software. You can change it. You can use export to convert user variables into environment variables.

User variables: user-defined, can be changed

(1) Internal variables (system variables, environment variables, parameter variables, predefined variables)

Internal variables are a special type of variables provided by Linux. These variables are used to make decisions in the program. The value of such variables cannot be changed within the shell program.

Description of representation

$n$1 represents the first parameter, $2 represents the second parameter...

$#Number of command line parameters

$0The name of the current program

修改环境变量linux_linux修改用户环境变量_linux修改环境变量的值

$?The return code of the previous command or function

$*Save all parameters in the "Parameter 1 Parameter 2..." mode

$@Save all parameters in the form of "Parameter 1" "Parameter 2"...

$$The (process ID number) PID of this program

(2)Environment variables

Linux environment (also known as shell environment) consists of many variables and the values ​​of these variables. The appearance of the environment is determined by the values ​​of these variables and variables. Such variables are environment variables.

修改环境变量linux_linux修改环境变量的值_linux修改用户环境变量

includes two parts, one is set by the system, mainly including: HOME, LOGNAME, MAIL, PATH, PS1, PWD, SHELL, TERM

Second, if the user sets it on the command line, use the export command, and the value will be lost when the user logs out

(3)User variables (private variables, local variables)

Set by yourself in the command line.

For more database and Linux technical content, please search "Chongqing Sizhuang"

linux修改环境变量的值_linux修改用户环境变量_修改环境变量linux

The above is the detailed content of There are three types of variable classifications of environment variables in Shell.. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1261
29
C# Tutorial
1234
24
Details on how to turn on environment variable settings on Windows 11 Details on how to turn on environment variable settings on Windows 11 Dec 30, 2023 pm 06:07 PM

The environment variable function is an essential tool for running the configuration program in the system. However, in the latest win11 system, there are still many users who do not know how to set it up. Here is a detailed introduction to the location of the win11 environment variable opening. Come and join us. Learn to operate it. Where are the win11 environment variables: 1. First enter "win+R" to open the run box. 2. Then enter the command: controlsystem. 3. In the system information interface that opens, select "Advanced System Settings" from the left menu. 4. Then select the "Environment Variables" option at the bottom of the "System Properties" window that opens. 5. Finally, in the opened environment variables, you can make relevant settings according to your needs.

PowerShell deployment fails with HRESULT 0x80073D02 issue fixed PowerShell deployment fails with HRESULT 0x80073D02 issue fixed May 10, 2023 am 11:02 AM

Do you see this error message "Add-AppxPackage: Deployment failed with HRESULT: 0x80073D02, The package cannot be installed because the resource it modifies is currently in use. Error 0x80073D02..." in PowerShell when you run the script? As the error message states, this does occur when the user attempts to re-register one or all WindowsShellExperienceHost applications while the previous process is running. We've got some simple solutions to fix this problem quickly. Fix 1 – Terminate the experience host process You must terminate before executing the powershell command

Explorer.exe does not start on system startup [Fix] Explorer.exe does not start on system startup [Fix] Jun 03, 2023 am 08:31 AM

Nowadays, many Windows users start encountering severe Windows system problems. The problem is that Explorer.exe cannot start after the system is loaded, and users cannot open files or folders. Although, Windows users can open Windows Explorer manually using Command Prompt in some cases and this must be done every time the system restarts or after system startup. This can be problematic and is due to the following factors mentioned below. Corrupted system files. Enable fast startup settings. Outdated or problematic display drivers. Changes were made to some services in the system. Modified registry file. Keeping all the above factors in mind, we have come up with some that will surely help the users

Steps to set the PATH environment variable of the Linux system Steps to set the PATH environment variable of the Linux system Feb 18, 2024 pm 05:40 PM

How to set the PATH environment variable in Linux systems In Linux systems, the PATH environment variable is used to specify the path where the system searches for executable files on the command line. Correctly setting the PATH environment variable allows us to execute system commands and custom commands at any location. This article will introduce how to set the PATH environment variable in a Linux system and provide detailed code examples. View the current PATH environment variable. Execute the following command in the terminal to view the current PATH environment variable: echo$P

How to configure python environment variables in Win11? Tips for adding environment variables in win11python How to configure python environment variables in Win11? Tips for adding environment variables in win11python Feb 29, 2024 pm 04:30 PM

Win11 system is the latest Windows operating system, and users may encounter some configuration problems when using it. Among them, configuring Python environment variables is a common requirement because it allows users to easily use Python commands from any location. This article will introduce how to configure Python environment variables in Win11 system so that users can use the Python programming language more conveniently. 1. [Right-click] this computer on the desktop, and select [Properties] in the menu item that opens; 2. Then, under related links, find and click [Advanced System Settings]; 3. In the system properties window, click [Environment] at the bottom Variables]; 4. In the environment variables window, under system variables, select [Path], and then click

How to quickly delete the line at the end of a file in Linux How to quickly delete the line at the end of a file in Linux Mar 01, 2024 pm 09:36 PM

When processing files under Linux systems, it is sometimes necessary to delete lines at the end of the file. This operation is very common in practical applications and can be achieved through some simple commands. This article will introduce the steps to quickly delete the line at the end of the file in Linux system, and provide specific code examples. Step 1: Check the last line of the file. Before performing the deletion operation, you first need to confirm which line is the last line of the file. You can use the tail command to view the last line of the file. The specific command is as follows: tail-n1filena

Windows 10 environment variable setting tutorial Windows 10 environment variable setting tutorial Jul 15, 2023 pm 06:09 PM

Environment variables are an important setting in the operating system, but some Windows 10 users still don’t know how to set environment variables. In fact, the method is very simple. Open the run window, call up the system characteristics window through the sysdm.cpl command, and then switch to the advanced tab. You will see a button for environment variables. Click this button to enter the setting of environment variables. interface, and then just set it up according to actual needs. How to set environment variables in Windows 10: 1. First open the run window on the computer, then enter sysdm.cpl in the window and press Enter. 2. Select Advanced in the system properties interface, and then click Environment Variables. 3. Here we can see the variables displayed, and we can create a new one on a single machine.

How to configure Tomcat environment variables How to configure Tomcat environment variables Oct 26, 2023 am 10:41 AM

To configure Tomcat environment variables, you need to add the CATALINA_HOME variable to the system and add the Tomcat installation path to the PATH variable. The steps in Windows are to first download and install Tomcat, open the system properties window, open the environment variable settings, add the Tomcat environment variable, modify the Path variable and verify the configuration. The steps in Linux are to first download and install Tomcat, open a terminal window, edit the bashrc file, add Tomcat environment variables, etc.

See all articles