[Top][All Lists]

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

Re: Inconsitent treatment of * (globbing)

From: Greg Wooledge
Subject: Re: Inconsitent treatment of * (globbing)
Date: Mon, 31 Jan 2011 11:44:20 -0500
User-agent: Mutt/

On Sat, Jan 29, 2011 at 12:58:56PM +0100, Pascal Wittmann wrote:
>   But if I use the expression ".*" in bash, I would expect from the
> behaviour of "*", that
>   ".*" don't include the file "..". But the fact is, that it does in bash.

This is done for compatibility with all the other shells.  If you want
to get different behavior, try playing with bash's GLOBIGNORE variable:

$ cd /tmp
$ sh -c 'echo .*'
. .. .AgentSockets .dcs.37dd79 .dcs.dcgtlock .dcs.trc1 .dcs.trc2 .dcs.utillock 
.mutt-imadev-16849-121.swp .x11start
$ bash -c 'echo .*'
. .AgentSockets .dcs.37dd79 .dcs.dcgtlock .dcs.trc1 .dcs.trc2 .dcs.utillock 
.mutt-imadev-16849-121.swp .x11start ..
$ bash -c 'GLOBIGNORE=.:..; echo .*'
.AgentSockets .dcs.37dd79 .dcs.dcgtlock .dcs.trc1 .dcs.trc2 .dcs.utillock 
.mutt-imadev-16849-121.swp .x11start

reply via email to

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