Script: Count how many positional paramers Given
#!/bin/bash
echo $# ---> This will calculate the number of arugents given at command prompt
seq $1 $2 --> $1 will be first argument & $2 will be second argument
[root@noisecover-dr Scripts]# ./pospar.sh 2 7 9 10 --> I have given 4 arguments
4 --> total number of arguments
2
3
4
5
6
7
echo $# ---> This will calculate the number of arugents given at command prompt
seq $1 $2 --> $1 will be first argument & $2 will be second argument
[root@noisecover-dr Scripts]# ./pospar.sh 2 7 9 10 --> I have given 4 arguments
4 --> total number of arguments
2
3
4
5
6
7
Comments
Post a Comment