I have been looking on Google for quite a while now and can\'t find anything that is matching what I need/want to do.
My objective is to write a script that takes tw
To set the positional parameters $1, $2, ...
, use the set command:
set foo bar baz
echo "$*" # ==> foo bar baz
echo $1 # ==> foo
set abc def
echo "$*" # ==> abc def
If you want to modify one positional parameter without losing the others, first store them in an array:
set foo bar baz
args=( "$@" )
args[1]="BAR"
set "${args[@]}"
echo "$*" # ==> foo BAR baz