-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chet Ramey
committed
Jul 1, 2019
1 parent
602eae4
commit 951bdaa
Showing
15 changed files
with
158 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# tests of the backslash-in-glob-patterns discussion on the austin-group ML | ||
|
||
: ${TMPDIR:=/var/tmp} | ||
|
||
ORIG=$PWD | ||
GLOBDIR=$TMPDIR/bash-glob-$$ | ||
mkdir $GLOBDIR && cd $GLOBDIR | ||
|
||
# does the pattern matcher allow backslashes as escape characters and remove | ||
# them as part of matching? | ||
touch abcdefg | ||
pat='ab\cd*' | ||
printf '<%s>\n' $pat | ||
pat='\.' | ||
printf '<%s>\n' $pat | ||
rm abcdefg | ||
|
||
# how about when escaping pattern characters? | ||
touch '*abc.c' | ||
a='\**.c' | ||
printf '%s\n' $a | ||
rm -f '*abc.c' | ||
|
||
# how about when making the distinction between readable and searchable path | ||
# components? | ||
mkdir -m a=x searchable | ||
mkdir -m a=r readable | ||
|
||
p='searchable/\.' | ||
printf "%s\n" $p | ||
|
||
p='searchable/\./.' | ||
printf "%s\n" $p | ||
|
||
p='readable/\.' | ||
printf "%s\n" $p | ||
|
||
p='readable/\./.' | ||
printf "%s\n" $p | ||
|
||
printf "%s\n" 'searchable/\.' | ||
printf "%s\n" 'readable/\.' | ||
|
||
echo */. | ||
|
||
p='*/\.' | ||
echo $p | ||
|
||
echo */'.' | ||
|
||
rmdir searchable readable | ||
|
||
cd $ORIG | ||
rmdir $GLOBDIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# according to Posix 2.13.3, a slash in a bracket expression renders that | ||
# bracket expression invalid | ||
shopt -s nullglob | ||
|
||
echo 1: [qwe/qwe] | ||
echo 2: [qwe/ | ||
echo 3: [qwe/] | ||
|
||
echo 4: [qwe\/qwe] | ||
echo 5: [qwe\/ | ||
echo 6: [qwe\/] |