Accidentally setting home

Patrick O'Callaghan pocallaghan at gmail.com
Sun May 29 04:01:09 UTC 2011


On Sat, 2011-05-28 at 20:29 -0700, suvayu ali wrote:
> Hi Patrick,
> 
> On Sat, May 28, 2011 at 8:22 PM, Patrick O'Callaghan
> <pocallaghan at gmail.com> wrote:
> >> >
> >> > $ ls \.[^.]*
> >> >
> >>
> >> Thanks a lot Patrick, I had no idea ls accepted regular expressions!
> >
> > It doesn't. You need to read up on how the Shell works.
> 
> I was under the impression the shell accepts simple globs like '?' for
> any single character and '*' for any one or more characters hence I
> assumed it is an ls feature. I just read the "pattern matching"
> section in 'man bash' and realised I was misinformed. :)

The use of regular expressions for filename matching dates back to the
beginnings of Unix. In fact on 16-bit machines it was actually done in a
separate program called /etc/glob, called by the Shell when needed,
since otherwise the Shell process would have been too big for the
address space (64Kb :-). Those days have long gone of course.

BTW this is where we get the verb "globbing" meaning "filename
expansion".

poc



More information about the users mailing list