BUT2/SCR/SCR1.2/TP06/tp06-reponses.txt

30 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2023-10-23 13:23:36 +02:00
tar xvf globpattern.tar
1.ls -d GLOB/gLob/*[[:upper:]]
2.ls -d GLOB/*[[:upper:]]*
3.ls -d GLOB/gLob/?[[:digit:]]*
4.ls -d GLOB/*[[:digit:]][[:digit:]]*
II)
1.(man bash ligne3380)
shopt [-pqsu] [-o] [optname ...]
Toggle the values of settings controlling optional shell behavior. The settings can be either those listed below, or, if the -o option is used,
those available with the -o option to the set builtin command. With no options, or with the -p option, a list of all settable options is dis
played, with an indication of whether or not each is set; if optnames are supplied, the output is restricted to those options. The -p option
causes output to be displayed in a form that may be reused as input. Other options have the following meanings:
-s Enable (set) each optname.
-u Disable (unset) each optname.
-q Suppresses normal output (quiet mode); the return status indicates whether the optname is set or unset. If multiple optname arguments are
given with -q, the return status is zero if all optnames are enabled; non-zero otherwise.
-o Restricts the values of optname to be those defined for the -o option to the set builtin.
2.shopt permet d'activer et desactiver des options du shell
shopt nullglob --> permet de savoir si l'option nullglob est activé ou desactivé
shopt -s nullglob --> permet d'activé l'option nullglob
shopt -q nullglob --> permet de désactivé l'option nullglob
l'option du shell "nullglob" fait sauter la sécurité
lorsqu'elle est desactivé, le programme renvoie une erreur lorqu'il y en a une.
lorsqu'elle est activé, le shell force l'execution