Skip to main content
1 of 2
Inian
  • 13.1k
  • 2
  • 42
  • 56

Because when you run a script, the parent shell (the one you run your commands from) starts a non-interactive shell to run your script which has interactive flag disabled i and only turns on two options

  • -h to locate and remember (hash) commands as they are looked up for execution.
  • -B to allow the shell to perform brace expansion

You can see the complete list of set options which will be seen in the output of $- - The Set Builtin

Inian
  • 13.1k
  • 2
  • 42
  • 56