Bash: slice of positional parameters
You can use the same format as for any other array. To extract the 2nd and 3rd elements from $@
, you would do:
echo "${@:1:2}"
- -
| |----> slice length
|------> slice starting index