Skip to main content
quoting
Source Link
n.r.
  • 2.3k
  • 3
  • 19
  • 32

How can I get a slice of $@ in Bash without first having to copy all positional parameters to another array like this?

argv=($@ "$@" )
echo $"${argv[@]:2};";

How can I get a slice of $@ in Bash without first having to copy all positional parameters to another array like this?

argv=($@)
echo ${argv[@]:2};

How can I get a slice of $@ in Bash without first having to copy all positional parameters to another array like this?

argv=( "$@" )
echo "${argv[@]:2}";
Source Link
n.r.
  • 2.3k
  • 3
  • 19
  • 32

Bash: slice of positional parameters

How can I get a slice of $@ in Bash without first having to copy all positional parameters to another array like this?

argv=($@)
echo ${argv[@]:2};