lukmac lukmac - 6 months ago 29
Bash Question

shell scripting: get a specified range of parameters

I normally come here if google doesnt work. So this time it goes like this:
In a function, i want to assign to a variable from the 4-th input parameter onward.

function foo {
use var
commands using $1, etc

So i think i cannot use shift, since i want to use $1 afterwards. I do not either want to use an extra var to store $1,$2,$3 and shift. So how should it work?

function foo {
    # ...