The following variables are used to get the positional parameters:
$1, $2, $3, etc.
$@
$#
But they are used for both positional parameters of the script and the positional parameters of a function.
When I use these variables inside a function, they give me the positional parameters of the function.
Is there a way to get the positional parameters of the script from inside a function?
ARGV=( "$0" "$@" )
. – Oct 03 '19 at 15:23% set a b c; echo ${@:0}
gives:zsh a b c
– Tom Hale Jun 30 '23 at 15:08