Daniel,
I am recreating the systems password, group and shadow
(when applicable) files.
So if the script is run on an sgi system, for example,
the files location is /etc. If it is run on a linux
machine is /usr/local/system. If there are new users,
create new directories for them: for sgis on /home,
for dec systems on /usr/home and /usr1/home. Once all
is done, email the system admins the status. Things
like that. I have to do the same stuff on all
systems, but the location, for example changes....
Does this make sense?
--- Daniel Gardner <[EMAIL PROTECTED]> wrote:
> S> I have a systems hash that contains the type of
> system
> S> as keys and the name of the machines as values:
>
> S> %systems = (
> S> sgi => ["sgi1", "sgi2"],
> S> linux => ["linux1", "linux2"],
> S> dec => ["dec1", "dec2"]
> S> };
>
> S> Now, each type of system has default values like
> an
> S> email help address, shell used, users home
> directory,
> S> etc. Something like this:
>
> S> %default = (
> S> sgi => ["sgi-help","/bin/csh","/home"],
> S> linux =>
> S> ["someaddress-help","/bin/bash","/usr/home"],
> S> dec =>
> ["help-desk","bin/kcsh","/usr1/home"]
> S> );
>
> S> Is there a way to combine this last hash into the
> S> first one or should I keep them separate?
>
> there's loads of ways you could hold the data. the
> first one that
> comes to mind looks like:
>
> %systems = (
> sgi => { defaults =>
> ["sgi-help","/bin/csh","/home"],
> machines => ["sgi1", "sgi2"],
> },
> linux => { defaults =>
> ["someaddress-help","/bin/bash","/usr/home"],
> machines => ["linux1", "linux2"],
> },
> dec => { defaults =>
> ["help-desk","bin/kcsh","/usr1/home"],
> machines => ["dec1", "dec2"],
> },
> );
>
> but it really depends on what it is you're doing
> with the data. you
> want to design your data structure around the
> processing, rather than
> designing a data structure that looks nice, but
> makes the code hard.
>
> perhaps if you let us know what you want to do with
> it we might be
> able to give some suggestions.
>
> hth,
> daniel
>
>
> --
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]