Get the App
SLTechnology News&Howtos  ›  Servers  › 

Solaris system environment variable declaration method

Shulou Source: shulou.com Published: 2022-06-02 18:54:03 10月02日 Update

Solaris system environment variable declaration method

When declaring environment variables in the solaris system, follow the following format:

Format one

Variable name = xxx

Export variable name

Format two

Variable name = xxx;export variable name

Note that the semicolon is the semicolon under the English half corner of the input method

Example:

# format 1 TMOUT=300export TMOUT# format 2 TMOUT = 300 incorrect variable declaration method under export TMOUTSolaris system

The following environment variable declaration method is incorrect in solaris systems, but is available in linux systems:

Export variable name = xxx

Example: export TMOUT=300

If you use this method to declare an environment variable and write it to a file such as / etc/profile, after executing the command:

Source / etc/profile or. / etc/profile

An error is reported when declaring environment variables, resulting in unreferenced environment variables in the profile file, resulting in program or script errors.

How was the problem discovered?

The problem was found when Rizhao strengthened the system security of the server, declared the TMOUT variable in the profile file in an incorrect way, and caused the file synchronization script in Zone 1 and 3 to fail to execute normally and troubleshoot the problem.

Tags: Variables environment system method name format file error problem semicolon example script security use half corner command is in server program input method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi macOS Docker Redmi MariaDB