How do I prevent a bash shell interpreter from taking any more arguments in a shell script?

  • Also see: Man page for bash.

                  -       Signal the end of options, cause all remaining  args  to
                          be assigned to the positional parameters.  The -x and -v
                          options are turned off.  If there are no args, the posi‐
                          tional parameters remain unchanged.

    This is to prevent any type of spoofing attacks. Like certain kinds of setuid root spoofing attacks.

    #! /bin/bash -

© Lightnetics 2024