Standard wildcard and regex
There is standard wildcard (gobbling pattern) and regex.
Seems like the author said imply they are different. See here: http://www.tldp.org/LDP/GNU-Linux-To...tml/x11655.htm What is the difference? I tried these commands: Code:
$ ls -a Thank you & Happy New Year!. |
These should help you: http://www.tldp.org/LDP/abs/html/globbingref.html and http://www.tldp.org/LDP/GNU-Linux-To...tml/x11655.htm
Note that a dot '.' is not one of the wildcard characters. Note also that '?' represents a single character and can't represent no characters at all. |
You will need to supply more information as explanations for each example you have shown are answered under the wildcards section. Perhaps the issue is that none of your examples are regular expressions ...
are you aware of this? The bash shell, by default, will expand wildcards when used in conjunction with commands, in your case ls. So to your examples: Code:
$ ls f?ile? -- show all files containing the character 'f' followed by any character, followed by string 'ile', followed by any character ... none exist |
Thanks folks.
This is a typo: Quote:
Quote:
First, bash parse the command, but it does not use regex. Bash use it own wildcard, i.e.globbing pattern. See here http://www.tldp.org/LDP/abs/html/globbingref.html Excerpts:" Bash does carry out filename expansion [1] -- a process known as globbing -- but this does not use the standard RE set. " My mistake was also this: dot is not a globbing pattern wildcard (which is different from regular regex). Then bash executes the command with the expanded arguments that were not escaped. The executed command use regular regex on the arguments, if there are any that escaped Bash's parsing. Here is blessings for everyone: Quote:
|
Quote:
for the regular expression unless the command involved does not use the same escape item. The rest of your information appears correct. |
Quote:
I should have mentioned that I was referring to quotes which prevents Bash from parsing the quoted arguments when used by commands like grep,.... etc. Code:
$ echo f?le? |
All times are GMT -5. The time now is 03:41 AM. |