Establece o borra los valores de las opciones de shell y los parámetros
posicionales.
Modifica el valor de los atributos de shell y los parámetros posicionales,
o muestra los nombres y valores de las variables de shell.
Opciones:
-a Marca las variables que se modifican o crean para exportación.
-b Notifica el término de trabajos inmediatamente.
-e Termina inmediatamente si una orden termina con un estado
diferente a cero.
-f Desactiva la generación de nombres de ficheros (englobamiento).
-h Recuerda la ubicación de las órdenes como se localizaron.
-k Todos los argumentos de asignación se colocan en el ambiente para una
orden, no solo aquellos que preceden al nombre de la orden.
-m Activa el control de trabajos.
-n Lee órdenes pero no las ejecuta.
-o nombre-opción
Establece la variable correspondiente a nombre-opción:
allexport igual que -a
braceexpand igual que -B
emacs usa una interfaz de edición lineal estilo emacs
errexit igual que -e
errtrace igual que -E
functrace igual que -T
hashall igual que -h
histexpand igual que -H
history activa la historia de órdenes
ignoreeof el shell no terminará después de leer EOF
interactive-comments
permite que haya comentarios en órdenes interactivas
keyword igual que -k
monitor igual que -m
noclobber igual que -C
noexec igual que -n
noglob igual que -f
nolog actualmente se acepta pero se descarta
notify igual que -b
nounset igual que -u
onecmd igual que -t
physical igual que -P
pipefail el valor de retorno de una tubería es el estado
de la última orden que sale con un estado diferente
de cero, o cero si ninguna orden termina con un
estado diferente de cero
posix modifica el comportamiento de bash donde la
operación por defecto difiere del estándar POSIX
para que coincida con el estándar
privileged igual que -p
verbose igual que -v
vi usa una interfaz de edición de línea estilo vi
xtrace igual que -x
-p Activo cuando los ids real y efectivo del usuario no coinciden.
Desactiva el procesamiento del fichero $ENV y la importación de
funciones de shell. Si se desactiva esta opción causa que el uid y
el gid efectivos sean iguales al uid y el gid real.
-t Termina después de leer y ejecutar una orden.
-u Trata las variables sin definir como un error al sustituir.
-v Muestra las líneas de entrada del shell mientras se leen.
-x Muestra las órdenes y sus argumentos mientras se ejecutan.
-B el shell realizará expansión de llaves.
-C Si se activa, no permite que los ficheros regulares existentes
se sobreescriban por redirección de la salida.
-E Si se activa, las funciones del shell heredan la trampa ERR.
-H Activa el estilo de sustitución de historia ! . Esta opción está
activa por defecto cuando el shell es interactivo.
-P Si se activa, no sigue enlaces simbólicos cuando se ejecutan órdenes
como cd, que cambian el directorio actual.
-T Si se activa, las funciones del shell heredan la trampa DEBUG.
-- Asigna cualquier argumento restante a los parámetros posicionales.
Si no restan argumentos, se desactivan los parámetros posicionales.
- Asigna cualquier argumento restante a los parámetros posicionales.
Las opciones -x y -v se desactivan.
Si se usa + en lugar de - causa que estas opciones se desactiven. Las
opciones también se pueden usar en la invocación del shell. El conjunto
actual de opciones se puede encontrar en $-. Los n ARGs restantes son
parámetros posicionales que se asignan, en orden, a $1, $2, .. $n. Si no
se proporciona ningún ARG, se muestran todas las variables del shell.
Estado de Salida:
Devuelve correcto a menos que se proporcione una opción inválida.