[Bash] Print out how many number of arguments and arguments Posted by Computer Newbie on 凌晨2:06 in bash script / No comments Bash Script : args=("$@") Number=("$#") echo $# arguments passed for i in $(seq 0 1 $Number) do echo ${args[$i]} done Result : Happy@Happy-laptop:~/Desktop$ bash test123.sh 1 2 3 4 5 6 7 8 8 arguments passed 1 2 3 4 5 6 7 8 Reference : In Bash, how do you access command line arguments inside a function? Bash For Loop Examples Share This: Facebook Twitter Google+ Stumble Digg 以電子郵件傳送這篇文章BlogThis!分享至 X分享至 Facebook
0 意見:
張貼留言