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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can we have functions in scripts

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi All:
I have a script that is growing to be a night mare to maintain. I want to break the script in several modules. Can we have function calls inside a script or we need to break it to several scripts and how can handle calls and. Also can you recommend a script tool that will give some debugging capabilities.

Thanks,
Ziad
 
You can use functions in korn shell :-

functionname ()
{
commands;
}

then just call the name when you want to use it later in the script

Ged Jones

Top man
 
Ziad,

You can call other shell scripts from a shell script, and then look at the value it returns to find out if things went ok.

Mike
michael.j.lacey@ntlworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top