help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Glob star pattern does not match files beginning with a


From: Greg Wooledge
Subject: Re: [Help-bash] Glob star pattern does not match files beginning with a period
Date: Wed, 15 Jul 2015 16:16:37 -0400
User-agent: Mutt/1.4.2.3i

> > On Mon, Jul 13, 2015 at 2:55 PM, Evan Gates <address@hidden> wrote:
> >> Almost. You want .[!.]* and ..?* so you don't miss files like ..foobar

On Wed, Jul 15, 2015 at 12:58:03PM -0700, Michael Convey wrote:
> ???I've done some more testing of this and found no difference between
> ???ls -dl .[!.]?*
> and
> ls -dl .[!.]*

You want BOTH of them at the same time.

imadev:~/tmp2$ touch .foo ..bar
imadev:~/tmp2$ echo .[!.]* ..?*
.foo ..bar

But really, if you are in bash, just use dotglob.  That's what it's for.
This cryptic .[!.]* ..?* stuff is only needed for lesser shells.

imadev:~/tmp2$ shopt -s dotglob
imadev:~/tmp2$ echo *
.foo ..bar

Nice and simple, right?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]