I have a shell script which takes 1 mandatory argument and upto 3 optional arguments and I want to enhance the script by able to pass one more additional argument without breaking the current design . That is if my argument is n and existing arguments are a and b c and d the following should work
./script.sh a b c d n
./script.sh a n
./script.sh a b n
./script.sh a b c n
"${var[@]}"for iterating over arrays --${var[*]}concatenates into a scalar, then string-splits and glob-expands it."two words".var=( "$@" )-- then you can have however many arguments you need.