Hi,

 

  I'm trying to accomplish some task using perl. So let

  me describe what I have.

 

  I have several systems of the following: 

 

  Unix:

            Sun - Solaris

            HP - HPUX

 

  Windows:

            Dell - Windows 2k

 

 

 Each of these OS's have specific commands that are specific

 not only to the OS but to the hardware as well. Wouldn't it be

 better if I created a header file that contains these commands

 and assigned them to a common variable?

 

 Example:

            

            $memory = 'prtconf | grep Memory | awk '{print $3}'

 

 That would be the command that would be executed only if OS

 is Solaris.

 

 Here is my thinking on this:

 

 In one file I will have a list of the commands:

 

Example:

 

            os_commands.pl

 

            with in that file have the following:

            

            # memory command for Solaris

            $memory = 'prtconf | grep Memory | awk '{print $3}'

 

      

            # memory command for HPUX

            $memory = 'adb -k /stand/vmunix /dev/mem'

 

            list of other commands for other OS's.

 

Then have the main perl program call those memory variables based

on that setting into the main perl code. 

 

So what you end up having is:

 

1 file called command_header.pl which only list all the possible commands

2. file will be the main perl code that just call or displaces the command
within

    the perl           

 

I'd appreciate the feedback if any.

            

 

 

  

 

            

 

Phillip Bruce
ISC Consultant, System Architect
Location: Dublin, CA
* Cell: 408-476-8658
* Office: 925-560-7853 
AIM: OkieUnix 

 

Reply via email to