I have a Bash script to which I am sending 10 arguments.
I'm trying to access the tenth argument开发者_StackOverflow社区, such as echo $10
.
Instead I get the first argument with a zero appended.
Any thoughts on how I can access the tenth argument?
Use ${10}
instead of $10
. You can use this for a seemingly arbitrary number of arguments. I've tested it up to ${100}
successfully.
精彩评论