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
Are there other (better) ways of doing this?
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
Are there other (better) ways of doing this?