What is the meaning of $1 in UNIX? $1 is the first commandline argument. If you run ./asdf.sh a b c d e, then $1 will be a, $2 will be b, etc. In shells with functions, $1 may serve as the first function parameter, and so forth.
What is $1 and $2 in shell script? These are positional arguments of the script. Executing ./script.sh Hello World. Will make $0 = ./script.sh $1 = Hello $2 = World. Note. If you execute ./script.sh , $0 will give output ./script.sh but if you execute it with bash script.sh it will give output script.sh .
What does echo $1 mean? $1 is the argument passed for shell script. Suppose, you run ./myscript.sh hello 123. then. $1 will be hello. $2 will be 123.
What is $- in Linux? $- (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. Though this bash parameter is rarely used.