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)
Price List Query for Item
SELECT qph.list_header_id, qph.name, qph.description, qphh.start_date_active, qphh.currency_code, q...
-
1. To download Ldt file for a Concurent Program FNDLOAD [username]/[password] O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct file_nam...
-
Here the article will describe about how to register WebADI to Responsibility menu Go to System Administrator --> Security --> Respo...
-
using the below query can check the invoice status. SELECT DECODE(AP_INVOICES_UTILITY_PKG.GET_APPROVAL_STATUS(AIA.INVOICE_...
No comments:
Post a Comment