Re: [SLUG] Shell script calling shell script

From: steve szmidt (steve@szmidt.org)
Date: Thu Nov 18 2004 - 21:03:32 EST


On Thursday 18 November 2004 05:15 pm, Chuck Hast wrote:
> I have a set of applications that I want to configure and start up. I am
> seeing that the general way it is done is to write the monolithic shell
> script that sets up ports, starts apps, etc. What I really want to do is
> have a master script that calls modular scripts that will then set up
> a port or start a app, then if I need to go in and change something I
> do not need to poke around the master script only go in and work on
> the port script that I want to change.
>
> My question is if my main script calls another one, when that one
> finishes, will it hand the execution back to the script that called it?
> That way say I have a machine that has 8 ports on it, each port has
> about 10 lines of configuration, if I want to remove a port I just go in
> and comment out the line that calls that port, I do not have to go in
> and comment out 8-10 lines of commands and parameters. If I want
> to add a port I just take a template and change the parameters are
> are port dependient and make a entry in the main script that calls
> it.

A script with a series of instructions will execute as written. However, if
you insert 'exec' it will turn over control to it and not return.

-- 

Steve Szmidt

"They that would give up essential liberty for temporary safety deserve neither liberty nor safety." Benjamin Franklin ----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:20:41 EDT