I need to copy all script arguments and pass them to another script. I have tried to do it like this:
args=$@ printargs.sh $args echo ------ printargs.sh
$@ is like an array, so your temporary storage needs to be an array:
$@
args=( "$@" ) # quotes are needed there
And then to use them:
printargs.sh "${args[@]}"