65 lines
2.0 KiB
Plaintext
65 lines
2.0 KiB
Plaintext
I.
|
|
1.
|
|
benji …/SCR/SCR1.2/TP06 main =$✘!? 15:54 ls GLOB/gLob/*[A-Z]
|
|
GLOB/gLob/44patterN GLOB/gLob/patterN GLOB/gLob/pAtterN
|
|
|
|
GLOB/gLob/paTTerN:
|
|
theglobpattern
|
|
|
|
2.
|
|
benji …/SCR/SCR1.2/TP06 main =$✘!? 16:02 ls GLOB/*[A-Z]*
|
|
GLOB/1glob22gloB333 GLOB/gloB1bloG
|
|
|
|
GLOB/gLob:
|
|
44patterN pAtterN patterN paTTerN Pattern4
|
|
|
|
3.
|
|
benji …/SCR/SCR1.2/TP06 main =$✘!? 16:06 ls GLOB/?[0-9]* GLOB/gLob/?[0-9]*
|
|
GLOB/11glob22blog3 GLOB/gLob/44patterN
|
|
|
|
4.
|
|
benji …/SCR/SCR1.2/TP06 main =$✘!? 16:06 ls GLOB/*[0-9][0-9]*
|
|
GLOB/11glob22blog3 GLOB/1glob22 GLOB/1glob22gloB333
|
|
|
|
II.
|
|
|
|
1.
|
|
If the extglob shell option is enabled using the shopt builtin, the shell recognizes
|
|
several extended pattern matching operators. In the following description, a pattern-
|
|
list is a list of one or more patterns separated by a |. Composite patterns may be
|
|
formed using one or more of the following sub-patterns:
|
|
|
|
?(pattern-list)
|
|
Matches zero or one occurrence of the given patterns.
|
|
*(pattern-list)
|
|
Matches zero or more occurrences of the given patterns.
|
|
+(pattern-list)
|
|
Matches one or more occurrences of the given patterns.
|
|
@(pattern-list)
|
|
Matches one of the given patterns.
|
|
!(pattern-list)
|
|
Matches anything except one of the given patterns.
|
|
|
|
|
|
2.
|
|
shopt sert à activer ou désactiver des options du shell
|
|
|
|
pour lister les fonctions activer il faut faire shopt sans options
|
|
pour activer une option -s (set) et pour désactiver -u (unset)
|
|
|
|
3.
|
|
|
|
a) cd *5
|
|
bash: cd: *5: Aucun fichier ou dossier de ce nom
|
|
|
|
b) benji /etc 17:02 shopt -s nullglob
|
|
|
|
c) benji /etc 17:02 builtin cd *5
|
|
|
|
benji ~ 17:02
|
|
|
|
|
|
|
|
|
|
|