What Is Called in Unix?
Contents

What is $# in Unix?

$# is a special variable in bash , that expands to the number of arguments (positional parameters) i.e. $1, $2 … passed to the script in question or the shell in case of argument directly passed to the shell e.g. in bash -c ‘…’ …. .

What is $- in bash?

$- $- (dollar hyphen) bash parameter is used to get current option flags specified during the invocation, by the set built-in command or set by the bash shell itself.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest