Shell setting noglob variable

Source: Internet
Author: User

14 noglob variable

Set noglob to stop the wildcard function, that is, the image symbol *? [] {}~ And so on. All of the special functions they represent will be ineffective. It only represents general characters. The following is an example:

% Echo ~
/Home1/Akira
% Echo *
Akbin Bourne cshell project soft
% Set noglob
% Echo ~
~
% Echo *
*

No. After the noglob variable is set, it indicates "~" in the home directory. And the symbol "*" all lose its original special utility. To use this variable, be sure to know what you are doing! Otherwise, do you think the computer is broken?

It is recommended that you manually set this variable if you need to temporarily stop the entire wildcard function. If there are only two or three lines of commands, we recommend that you use the Backslash "/" to temporarily remove special symbols. This method is also feasible. If you choose to set the noglob variable, do not forget that you only need to unset noglob to review the usage mode before the setting.

Sometimes when we write a C shell document, we often need to use special symbols as common symbols. You can set this variable to terminate the wildcard function,

Another method:

Set-O noglob # Set

Code ....

Set + O noglob # cancel setting

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.