Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Put parameter in function 1

Status
Not open for further replies.

h3nd

Programmer
Jul 1, 2006
147
AU
Hi guys,

Here's the part of the script, I have the function called usage and I want to put parameter in that function. How do I do that?

Code:
usage($tambah){
       echo $tambah
       echo ""
}

if [ $# -eq 0 ] ; then
        print ERROR: no [batch no] specified
        tambah="missing"
        usage($tambah)
        exit 1
fi

Thanks guys,
 
usage(){
echo $*
echo ""
}

if [ $# -eq 0 ] ; then
print ERROR: no [batch no] specified
usage "missing"
exit 1
fi

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top