set 10 20 30 40 50
Enter the value of the variable
$#
:
I understand that the variables $1=10
$2=20
and so on
set 10 20 30 40 50
Enter the value of the variable
$#
:
I understand that the variables $1=10
$2=20
and so on
In POSIX shells, the value of special built-in variable $#
corresponds to the number of positional parameters set. Ex.:
Set
$1
,$2
, and$3
and set "$#
" to 3:
set c a b
$# is the number of arguments $* are the arguments $@ are the arguments
Look at this
#!/bin/sh
set 1 2 3 4
echo "we had $# args"
echo Arguments are $@ using echo '$@'
echo Arguments are $* using echo '$*'