bug-bash
[Top][All Lists]
Advanced

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

GLOBIGNORE documentation


From: Stephane Chazelas
Subject: GLOBIGNORE documentation
Date: Sun, 6 Mar 2016 22:16:58 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Today, I realised that GLOBIGNORE doesn't work at all like ksh's
FIGNORE.

With

GLOBIGNORE=x*

we're not filtering out files whose *name* starts with "x" from
globs but those whose *path* starts with "x".

In

echo *

files whose name starts with "x" will be excluded, but not in

echo ./*

I think the documentation should be clarified, because at the
moment it implies GLOBIGNORE applies to file names (like for
ksh's FIGNORE), not file paths.

Where it becomes borderline a bug is about "." and "..".

The doc says they're always excluded when GLOBIGNORE is
non-empty.

That's true for */* or .* for instance, but not for ./.* or .*/x
for instance.

$ bash -c 'GLOBIGNORE=x*; echo .*'
.*
$ bash -c 'GLOBIGNORE=x*; echo ./.*'
./. ./..
$ bash -c 'GLOBIGNORE=x*; echo .*/a'
./a ../a

To truely exclude . and .., one needs:

shopt -s extglob
GLOBIGNORE='?(*/)@(.|..)'

-- 
Stephane




reply via email to

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