How can I access the values within $@ starting from the third one? Right now I'm passing them from three to nine, but I think theres a better way:
while getopts ":n" opt "$3 $4 $5 $6 $7 $8 $9"; do
|
How can I access the values within
| |||
|
feedback
|
|
Seems like a funky approach to arguments to me, but:
I recommend you check out the FAQ Answer about command line arguments (Which basically says getopts or loop/case/shift). | |||||||
feedback
|
|
I assume you are using bash in this instance? If so, you should use shift. An example: Contents of shift.sh:
Result:
| |||
|
feedback
|
shift 2and leave off the args after "opt". – Dennis Williamson Apr 19 '10 at 16:00