Linux set,env and Export

Source: Internet
Author: User
Set,env and export three commands can be used to display shell variables

set displays variables for the current shell, including variables for the current user env Displays the current user's variables Export Displays the shell variables currently exported as user variables

Each shell has its own unique variable, which is different from the user variable. The current user variable has nothing to do with what shell you use, no matter what shell you use. Such variables as Home,shell, but the shell's own variables, different shells are different, such as BASH_ARGC, Bash, and so on, these variables only set will be shown, is unique to BASH. When export does not add parameters, it shows which variables are exported as user variables, because a shell's own variable can be exported to a user variable via export.

[Email protected] root]# a=test
[Email protected] root]# echo $a
Test
[[Email protected] root]# set |grep a
A=test
[[Email protected] root]# env |grep A
[Email protected] root]# export a
[[Email protected] root]# env |grep A
A=test

Linux set,env and Export

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.