What does "$-" mean in bash or zsh? -
this question has answer here:
- how can ask bash current options? 1 answer
today found variable '$-' random string, don't know stands for.
➜ ~ echo $- 569jnrtxzghikms
and can't change value:
➜ ~ -='sss' zsh: command not found: -=sss ➜ ~
and, in docker was:
➜ ~ docker run --rm -ti ubuntu root@7084255fd54e:/# echo $- himbh
or:
➜ ~ docker run --rm -ti alpine ash / # echo $- smi
does it's value related system?
$-
current options set shell.
from the bash reference manual:
using ‘+’ rather ‘-’ causes these options turned off. options can used upon invocation of shell. current set of options may found in $-.
the remaining n arguments positional parameters , assigned, in order, $1, $2, … $n. special parameter # set n.
the return status 0 unless invalid option supplied.
Comments
Post a Comment