


There are three types of variable classifications of environment variables in 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
$?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.
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"
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!

Linuxoffersmoregranularcontroloverloggingandauditing,whileWindowsprovidesamorecentralizedsystem.1)Linuxusestoolslikesyslog,rsyslog,andjournaldforcustomizablelogging.2)WindowsusestheEventViewerforcentralizedlogmanagement.3)Linuxisidealforenvironmentsn

Artificial Intelligence (AI) is a term that’s been buzzing around for a while now, from self-driving cars to voice assistants like Siri and Alexa, AI is becoming a part of our everyday lives. But what exactly is AI, and why should Linux users care ab


For someone new to Linux, using it can still feel challenging, even with user-friendly distributions like Ubuntu and Mint. While these distributions simplify many tasks, some manual configuration is often required, but fully harnessing the power of L

In the previous article, we introduced the basics of AI and how it fits into the world of Linux. Now, it’s time to dive deeper and set up your Linux system to start building your first AI model. Whether you’re a complete beginner or have some exper

If you’re looking to manage your server with ease, Kloxo is a great option, as it is free and open-source web hosting control panel that allows you to manage your server and websites with a simple, user-friendly interface. In this guide, we’ll walk

If you’ve ever found yourself in a situation where you’re trying to move a bunch of files and folders, only to be stumped by spaces in the folder names, you’re not alone. Spaces in filenames or folder names can quickly become a frustrat


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
