Bash Shopt Examples

Last updated:
Table of Contents

WIP Alert This is a work in progress. Current information is correct but more content may be added in the future.

Set option

Use shopt -s option_name

Example enable dotglob in the current script

#!/usr/bin/env bash

shopt -s dotglob

Unset options

Use shopt -u option_name

Example disable dotglob in the current script

#!/usr/bin/env bash

shopt -u dotglob

Option list

TODO see here for now: https://bash.cyberciti.biz/guide/Shopt

Dialogue & Discussion