I am using bash shell on linux and want to use more than 10 parameters in shell script
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Use curly braces to set them off:
echo "${10}"
You can also iterate over the positional parameters like this:
for arg
or
for arg in "$@"
or
while (( $# > 0 )) # or [ $# -gt 0 ]
do
echo "$1"
shift
done
回答2:
You can have up to 255 parameters with:
${255}