It depends - as a dollar-sign expansion, $-
expands to a list of the current shell's set
table single-letter options - such as -x
and -f
and -C
. For an example, an interactive shell will expand it at least like:
echo "$-"
i
The longer, set -o option
versions can be had with set +o.
But there is another kind of hyphen-special-parameter which is a sort of analog to this. You can use two consecutive hyphens to signal the end of options in a typical command's argument list, but you can also use a single-hypen to do the same for a POSIX-shell. Historically, shells accepted a single hyphen to mean much the same.
A bash
shell interprets a single-hyphen specially in argument list-contexts. With set
, for example it marks the end of options and disables -v
erbose and -x
trace. Additionally, set -
does not clear a parameter list if it is the first and only argument to set
as set --
would.
A login shell will often append a -
to its argv[0]
.