"Wherever women are concerned, the unexpected always happens!" - so goes the saying. However, I would say, add 'unix' to it too.
So, it happened that I was using 'find' command to find a certain set of files:
- find . -name "filename*"
Now, having been brought up on the diet of regular expressions, I naively assumed that "filename*" must be also acting as a regular expression. However, as it turned out instead of being a regular expression, it is what they call a 'shell pattern'. To cut the long story short, the semantics of special characters in shell-pattern is different than that in regular expressions.
For example, the asterisk (*) means matching zero or more of any character in shell-pattern while in case of regular expressions, it means matching zero or more of the previous character, which could change the meaning entirely depending on context.
Find more on this at:
What I take from this is
ReplyDelete'*' in shell is equivalent to '.*' in regular expressions.