update repository
[cmdllinux.git] / bash_n_examples / bash / extglob / bash-extglob.sh
blob067005228ac9f2bb6cd8f13110eeec6885b93ba4
1 shopt -s extglob
2 A="ASASDD-D-F-G"
3 echo 1 ${A//S+([A-Z])-}
4 echo 2 ${A//S*([A-Z])-}
5 ##:(pattern) zero or one occurrences of the given patterns
6 ##*(pattern) zero or more occurrences of the given patterns
7 ##+(pattern) one or more occurrences of the given patterns
8 ##@(pattern) one of the given pattern
9 ##!(pattern) anything except one of the given patterns
10 echo 3 ${A/D*([A-Z-])-/__}
11 echo 4 ${A/%-*([GH])/-ES}
12 echo 5 ${A/%-*([GH])/}