2
votes
1answer
174 views

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};
5
votes
3answers
3k views

Transform an array into arguments of a command?

I have an array of "options" of a command. my_array=(option1 option2 option3) I want to call this command in a bash script, using the values from array as options. So, command $(some magic here ...