Detailed description of set command parameters and usage

Source: Internet
Author: User
Set command parameters and usage description linuxset command function description: set shell. Syntax: set [+-abCdefhHklmnpPtuvx] Supplement: you can use the set command to set various shell options or list shell variables. set common features for a single option. after some options-o... set command parameters and usage details linux set command function description: set shell. Syntax: set [+-abCdefhHklmnpPtuvx] Supplement: you can use the set command to set various shell options or list shell variables. set common features for a single option. after some options, The-o parameter opens special features. using the + o parameter after some options will disable some features. The set command without any parameters will display all shell variables. unless an invalid option is encountered, set always returns true. parameter number: allexport-a marks all the new and modified variables for output from the settings. braceexpand-B allows symbol extension. the default option is emacs during command editing, use the built-in emacs editor. the default option is errexit-e. if a Command returns a non-0 exit value (failed), it exits. histexpand-H can be used for temporary replacement! And !! The default option history allows command line history. the default option ignoreeof disables coontrol-D to exit shell. you must enter exit. Interactive-comments in interactive mode, # Used to indicate the annotation keyword-k. The Command places the keyword parameter in the environment. monitor-m allows the job to control noclobber-C. the protection file is not overwritten by noexec-n when it is used again. read the command but not execute it, it is mainly used to check the syntax structure. Noglob-d disables path name extension, that is, when the wildcard notify-B is disabled and the customer is notified of nounset-u after the background job, the error message onecmd-t is displayed. after reading and executing a new command, the onecmd-t exits physical-P. if it is set, when pwd and cd commands are used, the physical path posix is used to change shell behavior so as to meet POSIX requirements. once privileged is set, shell will not read any more. the profile file and the env file shell function do not inherit any environment. verbose-v enables verbose mode for debugging. vi uses the built-in vi editor xtrace-x to enable debugging echo mode settings during command line editing. system environment variables are described in the following two articles: set the environment variables to take effect permanently. export PS1: http://www.linuxso.com/a/linuxxitongguanli/1812.html Extended reading: the set, env, and export commands can be used to display shell variables. what is the difference? Set is used to display the local variable env is used to display the environment variable export is used to display and set the environment variable set to display the current shell variable, including the current user's variable env display current user's variable export display currently exported as user variable shell variable each shell has its own specific variable (set) display variables, this 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 as HOME and SHELL, however, shell variables are different from shell variables, such as BASH_ARGC and BASH. these variables are only displayed in set and are unique to bash. when export does not contain parameters, show which variables are exported as user variables, because a shell variable can be changed to a user variable through export "export" [root @ linux ~] # Aaa = bbb [root @ linux ~] # Echo $ aaabbb [root @ linux ~] # Set | grep aaaaaa = bbb [root @ linux ~] # Env | grep aaa [root @ linux ~] # Export aaa [root @ linux ~] # Env | grep aaaaaa = bbb extension 2: environment variable command in set, env, and export Linux is a multi-user operating system. Each user logs on to the system and has a dedicated runtime environment. Generally, the default environment of each user is the same. the default environment is actually the definition of a set of environment variables. You can customize your running environment by modifying the corresponding system environment variables. What is an environment variable? an environment variable is an object with a specific name. it contains information that will be used by one or more applications. Many users (especially those new to Linux) find these variables odd or difficult to control. Actually, this is a misunderstanding: by using environment variables, you can easily modify the configuration information of one or more applications. Common Environment variables are no stranger to environment variables such as PATH and HOME. The PATH can specify the search PATH of the command. what variables are used to specify the PATH of the dynamic link library? Or is it in PATH? For example, if a program needs a library file under/usr/local/lib, how should we specify its path? We often see some variables such as LD_LIBRARY_PATH, LIBPATH, and CLASSPATH. what are their differences and relationships? In addition, there are some common environment changes below. ◆ HISTSIZE refers to the number of historical Command Records. ◆ LOGNAME indicates the login name of the current user. ◆ HOSTNAME refers to the host name, which is usually obtained from this environment variable if many applications use the host name. ◆ SHELL refers to the Shell used by the current user. ◆ LANG/LANGUGE is a language-related environment variable, which can be modified by users in multiple languages. ◆ MAIL refers to the MAIL storage directory of the current user. ◆ PS1 is the basic prompt, which is # for root users and $ for common users. PS2 is an auxiliary prompt. the default prompt is "> ". You can modify this environment variable to modify the current command line. for example, the prompt will be changed to the string "Hello, My NewPrompt ".
Related Article

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.