-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathshell_options.txt
218 lines (204 loc) · 12.8 KB
/
shell_options.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
┏━━━━━━━━━━━━━━━━━━━┓
┃ SHELL_OPTIONS ┃
┗━━━━━━━━━━━━━━━━━━━┛
set -OPT_ABBR
set -o OPT_NAME
shopt -o -s OPT_NAME... #turns on une option simple du shell courant (voir doc)
set +OPT_ABBR
set +o OPT_NAME
shopt -o -u OPT_NAME... #turns off une option simple du shell courant (voir doc)
#!/bin/bash -OPT_ABBR #Il est possible de le declarer egalement apres le
#!/bin/bash +o OPT_NAME #Shebang
bash +OPT_ABBR scrit.sh #Il est possible aussi de le declarer dans la commande
bash -o OPTNAM scrit.sh #lancant le script (notamment en console). Certaines
#options, dont -i, ne sont valables qu'ainsi.
shopt -s OPT_NAME... #turns on une option complexe du shell courant
shopt -u OPT_NAME... #turns out une option complexe du shell courant
shopt #Imprime toutes les options complexes courantes et leur
shopt -p #valeur
shopt OPT_NAME #Imprime la valeur d'OPT_NAME
shopt -q OPT_NAME #Mode silencieux de shopt (teste une variable)
$- #ensemble des abbréviations des options simples (en
#ayant une) passees au shell
SHELLOPTS #ensembles des noms des options simples passées au shell
BASHOPTS #ensemble des options complexes passees au shell
#(Bash 4)
RESTRICTED MODE ==> #/bin/rbash équivaut à /bin/bash -r
LISTE D'OPTIONS #Voici la liste des options simples (I et N signifient
SIMPLES ==> #shell interactif ou non pour le fait que l'option soit
#activée par DEFO) :
ABBR NOM DEFO DESCRIPTION
I N
-B brace expansion O O #Enable brace expansion
-C noclobber N N #Prevent overwriting of files by redirection (may
#be overridden by >|)
-E errtrace N N #ERR-traps are inherited by shell functions,
#command substitutions, and subshells
-T functrace N N #DEBUG- and RETURN-traps are inherited by shell
#functions, command substitutions, and subshells
-H histexpand O N #Enable !-style history expansion.
-P physical N N #Don't follow symlinks when changing directories
#use the physical filesystem structure.
-a allexport N N #Export all defined variables
-b notify N N #Notify when jobs running in background terminate
#(don't wait for the next prompt), et exécute
#toute trap sur SIGCHLD également.
-e errexit N N #Abort script when a command exits with non-zero
#status (except in until or while loops, if-tests,
#&& and || constructs)
-f noglob N N #Globbing disabled
-h hashall O O #Remember the location of commands as they are
#looked up for execution.
-i interactive O N #Script runs in interactive mode
-m monitor O N #Job control is enabled. Background processes run
#in a separate process group and a line containing
#their exit status is printed upon their
#completion
-n noexec N N #Read commands in script, but do not execute them,
#useful for syntax check
-p privileged N N #Script runs as "suid"
-r restricted N N #restricted mode. Il devient interdit :
# - de tenter de supprimer le restricted mode
# - de tenter de lancer un nouveau shell (d'ou
# interdiction d'exec)
# - d'utiliser cd, command -p, enable
# - de rediriger les outputs
# - de changer $SHELLOPTS, $PATH, $SHELL,
# $BASH_ENV ou $ENV
# - de lancer une commande en utilisant son
# chemin
# - de mettre un chemin de fichier contenant un
# slash comme argument de source ou de hash -p
# - at startup, n'hérite pas des fonctions de son
# parent
-s stdin N N #Read commands from stdin
-t onecmd N N #Exit after first command
-u nounset N N #Attempt to use undefined variable outputs error
#message, and forces an exit
-v verbose N N #Print each command to stdout before executing it
-x xtrace N N #Similar to -v, but expands commands, print to
#stderr, et utilise PS4
emacs O N #Use an emacs-style command line editing interface
history O N #If set, command historization is done
ignoreeof N N #Set $IGNOREEOF to 10. See shell variables.
pipefail N N #If set, the exit code from a pipeline is
#different to the normal ("last command in
#pipeline") behaviour: TRUE when no command
#failed, FALSE when something failed (code of the
#rightmost command that failed)
posix N N #When set, Bash runs in POSIX mode.
vi N O #Enables a vi-style command line editing interface
LISTE D'OPTIONS #Voici la liste des options simples (I et N signifient
COMPLEXES ==> #shell interactif ou non pour le fait que l'option soit
#activée par DEFO).
#Les options suivantes sont propres à Bash 4 :
# - autocd
# - checkjobs
# - compat32
# - compat40
# - dirspell
# - globstar
#INTER décrit si l'option doit avoir en shell interactif
#(I), non-interactif (N), ou les deux (IN)
#Voici donc :
NOM DEFO INTER DESCRIPTION
I N
autocd N N I #Une commande correspondant à un chemin de
#répertoire exécute cd "ce répertoire"
cdable_vars N N IN #Si dans cd STRING, STRING n'est pas un chemin
#valide, le considère comme une $VAR contenant un
#chemin
cdspell N N I #Minor errors in the spelling of DIR dans cd DIR
#will be corrected :
# - character used for another
# - a missing character
# - a character written twice
checkhash N N IN #checks that a command found in the hash table
#exists before trying to execute it. If a hashed
#command no longer exists, a normal path search is
#performed.
checkjobs N N I #lists the status of any stopped and running jobs
#before exiting an interactive shell. If any jobs
#are running, this causes the exit to be deferred
#until a second exit is attempted without an
#intervening command. The shell always postpones
#exiting if any jobs are stopped.
checkwinsizeN N IN #checks the window size after each command and, if
#necessary, updates the values of the variables
#LINES and COLUMN
cmdhist O O IN #save all lines of a multiple-line command in the
#same history entry. This allows easy re-editing of
#multi-line commands.
compat31 N N IN #Compatiblity mode for Bash 3.1
compat32 N N IN #Compatiblity mode for Bash 3.2
compat40 N N IN #Compatiblity mode for Bash 4.0
dirspell N N IN #Bash will perform spelling corrections on directory
#names to match a glob.
dotglob N N IN #* includes dotfiles (sauf . et ..)
execfail N N N #will not exit if it cannot execute the file
#specified as an argument to exec
expand_
aliases O N IN #aliases are expanded
extdebug N N IN #behavior intended for use by debuggers is enabled,
#comme le fait d'afficher le numéro de ligne et
#source file des fonctions)
extglob N N IN #Active le globbing étendu. Doit être activé une
#ligne avant l'utilisant des extended pattern
#(ligne séparée par newline et non ;)
extquote O O IN #$' ' is performed within parameter expansions
#enclosed in double quotes. Doit être activé une
#ligne avant l'utilisant des extended pattern
#(ligne séparée par newline et non ;)
failglob N N IN #globbing failing to match filenames during result
#in an error message.
force_
fignore O O I #the files with names ending by the FIGNORE shell
#variable are not auto-completed
globstar N N IN #recursive globbing with ** is enabled.
gnu_errfmt N N IN #shell error messages are written in the "standard
#GNU error message format".
histappend N N I #the history list is appended to the HISTFILE when
#the shell exits, rather than overwriting it
histreedit N N I #Able to re-edit a failed history substitution
histverify N N I #Allow to review a history substitution result by
#loading the resulting line into the editing
#buffer, rather than directly executing it.
hostcompleteO O I #If set, Bash completion also completes hostnames.
huponexit N N I #If set, Bash will send the SIGHUP signal to all
#jobs when an interactive login shell exits.
interactive
_comments O O I #Allow commenting in interactive shells
lithist N N I #if the cmdhist option is enabled, multi-line
#commands are saved to the history with embedded
#newlines rather than using semicolon separators
#where possible.
login_shell N N IN #The option is set when Bash is a login shell. This
#is a readonly option.
mailwarn N N I #If set, and a file that Bash is checking for mail
#has been accessed since the last time it was
#checked, the message "The mail in mailfile has
#been read" is displayed.
no_empty_
cmd_
completion N N I #Bash will not autocomplete on an empty line.
nocaseglob N N IN #Words containing globbing for performing pathname
#expansion get case-insensitive, ainsi que les tests
# [[ =~ ]].
nocasematch N N IN #case structures et [[ ]] tests ( ==, !=, =~ )
#deviennent insensibles à la casse
nullglob N N I #patterns which match no files expand to a null
#string, rather than themselves.
progcomp O O I #Autocompletion is enabled
promptvars O O I #prompt strings undergo :
# - parameter expansion
# - command substitution
# - arithmetic expansion
# - quote removal
#after being expanded using the prompt sequence
restricted #The option is set when Bash is a restricted shell.
_shell N N I #This is a readonly option.
shift_ #shift prints an error message when the shift count
verbose N N I #exceeds the number of positional parameters.
sourcepath O O I #source builtin uses PATH to find the directory
#containing the file supplied as an argument
xpg_echo N N I #echo a toujours l'option -e d'impliqué