Finally understand the meaning of set env export declare and profile. Take bash as an example. When linux is started, it will read the/etc/profile file. In fact, this file is a shell script file, so you can define some environment variables in this file. Note: The variables defined in this file are system variables, that is, these variables exist as long as the operating system is started and are irrelevant to whether the user logs on. When each user logs on, linux starts a user logon shell, which reads $ HOME /. profile (or $ HOME /. bashrc) file, so the variables defined in these files are called user variables, which exist only after the user logs on to -www.2cto.com-successfully. Note: Both system variables and user variables can be directly used by logged-on users. The difference is that different users may have different user variables. If you use the set command without parameters, the displayed result is: System variable + User variable without parameters using the env command. The displayed result is: the user variable uses the export command without parameters. The displayed result is: the system variables exported as user variables use the declare command without parameters. The results are the same as those of the set command.
Author f543711700