The below code snippet shows how can check whether the minimum number for paramters are passed to the shell script or not.
-bash-3.2$ cat check_min_params
MINPARAMS=10
echo "All the command-line parameters are: "$*""
if [ $# -lt "$MINPARAMS" ]
then
echo
echo "This script needs at least $MINPARAMS command-line arguments!"
fi
echo
exit 0
OUTPUT :
-bash-3.2$ sh check_min_paramsAll the command-line parameters are:
This script needs at least 10 command-line arguments!
-bash-3.2$ sh check_min_params p1 p2 p3All the command-line parameters are: p1 p2 p3
This script needs at least 10 command-line arguments!
-bash-3.2$ sh check_min_params p1 p2 p3 p4 p5 p6 p7 p8 p9 p10All the command-line parameters are: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10
$# --> Total number of parameter passed from shell script command line to the program.
A Language is not worth knowing unless it teaches you to think differently.
Subscribe to:
Post Comments (Atom)
Item - Category Query
SELECT msi.segment1 AS Item_Code, msi.DESCRIPTION AS Item_Desc, mcs.CATEGORY_SET_NAME, mck.CONCATENATED_SEGMEN...
-
1. To download Ldt file for a Concurent Program FNDLOAD [username]/[password] O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct file_nam...
-
The profile information available in the HZ_CUSTOMER_PROFILES can be created in three levels namely Party, Customer Account and Customer...
-
Here the article will describe about how to register WebADI to Responsibility menu Go to System Administrator --> Security --> Respo...
No comments:
Post a Comment