Linuxstar
Published on

shopt command-set switches that control shell behavior variables

Jonas

Jonas

1 min read

The shopt command can set the switch values ​​of the variables that control the behavior of the Shell to achieve the purpose of controlling the behavior of the Shell. When executing the command shopt without any parameters, those characteristics and their states controlled by shopt will be listed.

Syntax: shopt [parameter]

Command parameters
-sWithout options, all open options are displayed. If followed by the corresponding option, turn on this option
-uWithout options, all unopened options are displayed. If followed by the corresponding option, turn on this option
-pShow all options
Example

Show all configuration options:

[root@linuxstar ~]# shopt -p 

View the open configuration options:

[root@linuxstar ~]# shopt -s

View the closed configuration options:

[root@linuxstar ~]# shopt -u