Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • that worked, thanks. Do you you know if this lists the options that are settable by both set and shopt? Commented Jun 17, 2015 at 7:13
  • @user4668401 No, set is far more extensive: see the man page entry. Commented Jun 17, 2015 at 7:15
  • And to check if a single option is on: shopt <option> Commented Jun 17, 2015 at 7:29
  • 2
    checking with shopt <shoptoption> only works with shopt shell options, e.g. it works for shopt nullglob, as nullglob is a shopt shell option. However shopt pipefail fails, because pipefail is a set shell option. To check a set shell option using the shopt command, use shopt -o <setoption>; e.g. shopt -o pipefail works. Commented Jul 20, 2023 at 10:44