Re: Locate with exclude?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steven W. Orr wrote:
> On Monday, Feb 19th 2007 at 13:37 -0600, quoth Mikkel L. Ellertson:
> 
> If you don't mind me getting picky... 
> 
> Shell commandlines have no idea about regular expressions. They do however 
> know about globbing which is still a powerful construct but nowhere near 
> as powerful as what regular expressions can do.
> 
> Had the above example been a regex, it would have been written 
> differently:
> 
> ls /dev/[sh]d.*
> 
> In the first case, "Expand to /dev/ followed by either an s or an h 
> followed by a d followed by anything or possibly nothing."
> 
> In the second case, "Expand to /dev/ followed by either an s or an h 
> followed by a d followed by any character which is allowed to repeat zero 
> or more times.
> 
> Just so you don't either feel stupid or think I am ;-) right now, the 
> example here is the worst possible to demonstrate the point because this 
> glob doesn't need anything more than what a regex could provide. But 
> suffice it to say that there is a huge difference.
> 
I do feel stupid - as you say, I picked a bad example, and didn't
even think about the difference between globbing and regular
expressions. I know better then that, but I was not thinking. Thank
you for clearing this up!

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux