How do I find the number of arguments passed to a Bash script?

后端 未结 5 1827
暖寄归人
暖寄归人 2020-12-04 08:31

How do I find the number of arguments passed to a Bash script?

This is what I have currently:

#!/bin/bash
i=0
for var in \"$@\"
do
  i=i+1
done
         


        
5条回答
提交回复
热议问题