can anyone explain this?

this is the mksys b script....
can anyone explain .. what # and 1 in if condition

this is the first line of the script... it is not from middle of the script....

if [ "$#" -ne 1 ]
then
   echo "Not enough parameters, need a client name for mksysb"
   Usage="Usage: $0 <client name>"
   UsageExample="Usage Example: $0 devdbms1"
   echo $Usage
   echo $UsageExample
   var_mksysb_exec_return_code=99
   echo "Return Code - $var_mksysb_exec_return_code"
   exit $var_mksysb_exec_return_code
fi

$# is the number of parameters given to the script - [ ] tests whether the number of parameters equals 1 - if not one then display the usage example.

$# = parameter count
-ne = not equal for integers

the if condition say:

If the argument-count ('$#') given to the program dosnt equal (-ne) one (1)

  • Display help on how to use the program.