What are environment variables? What is the use?

Compared with some variables set for the system or user applications, the specific role of environment variables is of course related to specific environment variables. Like path, it tells the system that when the system is required to run a program without telling it the full path where the program is located , the system should look for the program in those directories besides the current directory; like in tc or bc++, set include=path1;path2; is to tell the compiler where to find the .h type file; of course Not only to specify the path, but also other functions, such as set dircmd=/4 The function of setting an environment variable is that when using the dir command, the default parameter of /4 will be added to your dir command, just For example, each of your commands has added the /4 parameter, which is actually an environment variable set for the command interpreter command or set for the internal command dir.

Q: What are environment variables? What is the use? 

Environment variables are strings containing environmental information about the system and the currently logged-in user , which some software programs use to determine where to place files (such as temporary files ).

To put it bluntly, the environment variable is to specify the path of a software. For example, when configuring software such as TomcatJdk, the environment variable must be set. Methods as below:

Click on My Computer and right click - Properties - Advanced - Environment Variables - New - Name/Path. 

Environment variables are strings that contain things like drive, path, or file names. Environment variables control the behavior of various programs. For example, the TEMP environment variable specifies where programs place temporary files.

Any user can add, modify, or delete a user's environment variables. However, only administrators can add, modify, or delete system environment variables.
 

Simply put, an environment variable is to set certain data, files or folders to the system default value, so that you don’t need to give the full path and address or set it when you call it, just use the name directly

For example, the copy command, it is actually under the windows folder, but we can call it anywhere because we have set the widows folder as an environment variable

Guess you like

Origin blog.csdn.net/Mr_ZhouR/article/details/81776470