shopt options in Bash

Source: Internet
Author: User

shopt options in Bash

Http://blog.chinaunix.net/uid-20587169-id-1919110.html

The shopt command is used to display and set the behavior options in the shell to enhance the shell's ease of use. shopt command without any parameter options, you can display all the shell action options that you can set.

The SET option and the SHOPT option are two different sets of content, with Set-o and shopt-p to view all open and closed entries for each of the two groups, in the default state, some are open, some are off, and the shopt options are incremented with the bash version. The basic operations associated with SHOPT are as follows:
# shopt-p List all options
# shopt-s List all open options
# shopt-s Extglob Open Extglob options
# shopt-u list all closed options
# shopt-u Extglob off Extglob option

Description of the column:
Cdspell when a CD enters a directory, if the directory name is accidentally misspelled, a letter is wrong or missing, you can enter the directory as well.
Dotglob a hidden file that begins with a point can be represented as normal with a wildcard character without a dot in front of it.
Extglob can be used in RM! (*jpg) This way to delete all file names not ending in jpg, or RM *@ (jpg|png) to say "or", of course, there are other ...
You need to familiarize yourself with these options during bash and find the settings that match your tastes.

Glob mode

*,?,[]

shopt options in Bash

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.