如何查找传递给Bash脚本的参数数量?
这就是我目前所拥有的:
#!/bin/bash i=0 for var in "$@" do i=i+1 done
还有其他(更好)的方法吗?
bash arguments
arguments ×1
bash ×1