开发者

Too many arguments to Bash script?

开发者 https://www.devze.com 2023-03-18 22:03 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消