I want to create a bash function that will accept variable number of parameters. There must be at least one parameter. Then I call another program and need to insert fixed values between the first parameter accepted and the rest of parameters.
I do it based on this answer
tt() {
name="$1"
params="${@:2}"
someapp ${name} 1234 /some/path "${params}"
}
But it doesn't work as intended as if I call it
tt John has fun
the resulting call will be
someapp John 1234 /some/path 'has fun'
note quotes, while I need the result to be
someapp John 1234 /some/path has fun
with two last args not in common quotes.