parameter passing - How to remove first bash argument and pass the others to another command? -


in bash $@ contains arguments used call script looking solution remove first one

./wrapper.sh foo bar baz ...:   #!/bin/bash   # call `cmd` bar baz ... (withouyt foo one) 

i want call cmd bar baz ...

you can use shift shift argument array. instance, following code:

#!/bin/bash echo $@ shift echo $@ 

produces, when called 1 2 3 prints 1 2 3 , 2 3:

$ ./example.sh 1 2 3 1 2 3 2 3 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -