Hi,

  It has come to my attention that I need a little understanding
  of what I'm doing here. Gary has provide some overview but not
  Technical detail as I would like to have. That isn't his fault.
  I admire his feedback for sure.

  The code is obvious using hash. This is something I think I need
  to get a little more clarity on. I would appreciate some feedback
  Using the declaration I've setup here.

#
# List of Operating Systems
#
my %whichos=('SunOS'    =>'sol', 
             'Aix'      =>'aix', 
             'HP-UX'    =>'hpux', 
             'Micorsoft'=>'W2K');

#
# List of Commands OS specific
#

my %commands = ('sol'=>{'hostname'=>'uname -n', 
                        'os'        =>'uname -s',
                        'osver'     =>'uname -r',
                        'osrel'     =>'cat /etc/release | awk \'{print
$3}\'',
                        'srvtype'   =>'uname -p',
                        'srvmodel'  =>'uname -i | cut -f2 -d ","',
                        'memory'    =>'prtconf | grep Memory | awk \'{print
$3}\'',
                        'cpu'     =>'psrinfo | awk \'{print $1}\' | wc -l'}
                        );

With my declared array of whichos and commands. I need to understand
What is considered the value and what is consider the key. 

In whichos I think SunOS is the key and the value is sol.
In commands I think sol is the key and then a secondardy key is hostname
with the value of uname -n.

To me it looks as though whichos is a dual deminsioned array while commands
Is a 3 x 3 deminsioned array.

Have I got this correct so far or am I'm off my rocker?

So if I'm going to search thru this array maybe use the following:

 Foreach $OS (key $whichos){
   Foreach $CMD {key $command{$OS}){
      Print $CMD;  <=== This should list out the values in commands array.
   }
 }

I think once I understand that then it be easier for me to understand how
To assign that $CMD variable properly. Thanks for the feedback.
    

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to