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
Post a Comment