Linux command shopt

Source: Internet
Author: User
The shoptshopt command in linux is an alternative to the set command, which is similar to the set command in many aspects, but it adds many options. You can use the-p option to view the shopt option settings. -U indicates a reset option, and-s indicates that the option is currently set. [Root @ lo the shopt command in linux is an alternative to the set command. it is similar to the set command in many aspects, but it adds many options. You can use the "-p" option to view the shopt option settings. "-U" indicates a reset option, and "-s" indicates that the option is currently set. [Root @ localhost ~] # Shopt-p # check the current settings. shopt-u accept-u cdspellshopt-u checkhashshopt-s accept histshopt-u accept-u execfailshopt-s accept-u extdebugshopt-u extglobshopt -s extquoteshopt-u failglobshopt-s hour-u histreeditshopt-u histappendshopt-u histverifyshopt-s hostcompleteshopt-u huponexitshopt-s interactive_commentss Hopt-u lithistshopt-s login_shellshopt-u mailwarnshopt-u region-s progcompshopt-s region-u region-s sourcepathshopt-u xpg_echo [root @ localhost ~] # Shopt-s cdspell # Open the cdspell option [root @ localhost ~] # Shopt-p cdspell # print cdspell settings shopt-s cdspell [root @ localhost ~] # Cd/raot # intentional spelling error/root [root @ localhost ~] # Pwd # view the current directory/root [root @ localhost ~] # Cd/usr/loca/bin # intentional spelling mistake/usr/local/bin [root @ localhost bin] # pwd # view the current directory/usr/local/bin [root @ localhost bin] # shopt-u cdspell # Open the cdspell option [root @ localhost bin] # shopt-p cdspell # print cdspell settings shopt-u cdspell [root @ localhost bin] # cd/ raot # intentional spelling mistake-bash: cd:/raot: no file or directory # enter directory error shopt command option meaning cdable_vars if the parameter of the built-in command for cd is not a directory, it is assumed that it is a variable name, the variable value is the directory to be converted to cdspell to correct the small spelling error of the directory name in the cd command. Check errors include characters in reverse order, missing characters, and repeated characters. If you know a change, the correct path will be printed and the command will continue. It is only used for interactive shellcheckhash bash. before trying to execute a command, search for it in the hash table to check whether the command exists. If the command does not exist, run the normal path search checkwinsize bash to check the window size after each command. if necessary, update the values of LINES and COLUMNS. cmdhist bash tries to save all rows of a multi-line command in the same historical item. This makes it easier for dotglob bash to re-edit multi-line commands. The results of file name extension include (.) if an interactive shell cannot execute a file with the built-in exec command as a parameter, it will not exit. If exec fails, an interactive shell will not exit the extended expand_aliases alias. The default value is to enable extglob and enable extended mode matching feature (the normal expression metacharacters are from the file name extension of the Korn shell). histappend when the shell exits, the history list will be added to the file named after the value of the HISTFILE variable, instead of overwriting the file histreedit. if readline is in use, you will have the opportunity to edit a failed history to replace histverify, and readline is in use. The historical replacement results are not passed to the shell parser immediately. Instead, it loads the result row into the readline editing buffer and allows further modification of hostcomplete. if the setting is in use and readine is in use, bash will attempt to execute host name completion when a word containing @ is being completed. By default, huponexit is enabled. if it is set, when an interactive login shell exits, bash will send a SIGHUP (suspension signal) to all jobs interactive_comments in an interactive shell, words starting with # and other characters in the same line can be ignored. By default, lithist is enabled. if the cmdhist option is enabled, multiline commands save the embedded linefeed to the history, instead of using semicolons to separate mailwarn, bash is used to check whether The file of The email has been accessed since The last check. The message "The mail in mailfile has been read" nocaseglob is displayed. if it is set, when The file name extension is executed, bash matches the file name nullglob in case-insensitive mode. If this parameter is set, bash allows the file name mode that does not match any file to be extended into an empty string instead of their own promptvars. If this parameter is set, it indicates that the string is extended before it goes through variable and parameter extension. Restricted_shell is enabled by default. if the shell is started in Restricted Mode, this option is set. This value cannot be changed. When executing the startup file, you cannot reset this option to allow the startup file to find whether the shell is a restricted sourcepath. if this option is set, the source built-in command uses the value of PATH to find the directory containing the files provided as parameters. By default, the source point (.) is enabled (.) if this option is set, when the moving count exceeds the number of positional parameters, the shift built-in command will print an error message starting from Bash 3.1, introducing the new option nocasematch, this allows Bash to ignore case sensitivity when comparing styles. Shopt-s nocasematch # Open option
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.