In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail the example analysis of the parameters of the Linuxexport command. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
The Linuxexport command, the export command, will cause the system to define a copy of this variable when each new shell is created. This process is called variable output.
Linuxexport command function description
Sets or displays environment variables.
Syntax: export [- fnp] [variable name] = [variable setting value]
Additional note: when executing a program in shell, shell provides a set of environment variables. Export can add, modify or delete environment variables for use by subsequent programs. The validity of export is limited to this login operation.
Introduction to Linuxexport command parameters
-f represents the function name in [variable name].
-n deletes the specified variable. The variable is not actually deleted, but it is not output to the execution environment of subsequent instructions.
-p lists all the environment variables assigned to the program by shell.
When a variable is created, it is not automatically known to the shell process created after it. The command export can pass the value of the variable to the following shell. When a shell script is called and executed, it does not automatically gain access to the variables defined in the original script (caller) unless those variables have been explicitly set to available. The export command can be used to pass the values of one or more variables to any subsequent script.
After logging in to the system, the system starts a user shell. In this shell, you can use shell commands or declare variables, or you can create and run shell scripts. When you run the shell script, the system creates a child shell. At this point, there will be two shell in the system, one is the shell started by the system when logging in, and the other is the shell created by the system to run the script. When a script finishes running, its script shell terminates and you can return to the shell before the script was executed. In this sense, a user can have many shell, and each shell is derived from some shell (called the parent shell).
Variables defined in a child shell are valid only within that child shell. If a variable is defined in a shell script, when the script runs, the defined variable is only a local variable within the script, and other shell cannot reference it. To make the value of a variable can be changed in other shell, you can use the export command to output the defined variable.
The variables established by # echo$PKG_PATH at any time are only local variables of the current shell, so they cannot be used by other commands or shell programs that shell runs. Export is to pass the environment variable you set to the child SHELL of the current SHELL to make it valid in the child SHELL.
This is the end of this article on "sample analysis of Linuxexport command parameters". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.