HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

shopt — Manage Bash shell options: variables (stored in `$BASHOPTS`) that control behavior specific to the B

Submitted by: @import:tldr-pages··
0
Viewed 0 times
shellcommandoptionsshoptmanageclivariablesbash

Problem

How to use the shopt command: Manage Bash shell options: variables (stored in $BASHOPTS) that control behavior specific to the Bash shell. Generic POSIX shell variables (stored in $SHELLOPTS) are managed with the set command instead. More information: <https://www.gnu.org/software/bash/manual/bash.html#The-Shopt-Builtin>.

Solution

shopt — Manage Bash shell options: variables (stored in $BASHOPTS) that control behavior specific to the Bash shell. Generic POSIX shell variables (stored in $SHELLOPTS) are managed with the set command instead. More information: <https://www.gnu.org/software/bash/manual/bash.html#The-Shopt-Builtin>.

List of all setable options and whether they are set:
shopt


Set an option:
shopt -s {{option_name}}


Unset an option:
shopt -u {{option_name}}


Print a list of all options and their status formatted as runnable shopt commands:
shopt -p


Display help:
help shopt

Code Snippets

List of all setable options and whether they are set

shopt

Set an option

shopt -s {{option_name}}

Unset an option

shopt -u {{option_name}}

Print a list of all options and their status formatted as runnable `shopt` commands

shopt -p

Display help

help shopt

Context

tldr-pages: common/shopt

Revisions (0)

No revisions yet.