From https://www.gnu.org/software/bash/manual/bashref.html#The-Set-Builtin
set [--abefhkmnptuvxBCEHPT] [-o option-name] [argument …] set [+abefhkmnptuvxBCEHPT] [+o option-name] [argument …]
...
--
If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parameters are set to the arguments, even if some of them begin with a ‘-’.
-
Signal the end of options, cause all remaining arguments to be assigned to the positional parameters. The -x and -v options are turned off. If there are no arguments, the positional parameters remain unchanged.Using ‘+’ rather than ‘-’ causes these options to be turned off. The options can also be used upon invocation of the shell. The current set of options may be found in $-.
The remaining N arguments are positional parameters and are assigned, in order, to $1, $2, … $N. The special parameter # is set to N.
It seems that there are three ways to set the position parameters:
set -- argument
set - argument
set argument
What are their differences?
Thanks.
set - ...
unspecified and only coverset -- ...
. Beyond that, I don't know what you're asking. The difference is the number of hyphens. The difference in effect (if any) is precisely described in the very document you've quoted. Their differences metaphysically or in general semantics is outside the scope of this site.