1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
shopt -s extglob DIR=$TMPDIR/extglob-$$ mkdir $DIR cd $DIR touch a.log echo *(.) echo *(.)* echo *(foo) echo *(foo|bar) echo ?(foo)* echo ?(foo) echo *(foo)* echo @(|foo)* echo *(foo).* echo *(foo|bar).* echo !(foo)* echo !(foo|bar)* cd $OLDPWD rm -rf $DIR