The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 10-04-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Something like this then.

Code:
# early on in the script
uname=$(uname)

# now whenever you need to branch
case $uname in
  AIX)  do aix stuff
        do some more aix stuff;;
  Solaris)
        do solaris stuff;;
esac
You will probably want to experiment a bit with a suitable uname string. I'm guessing it might be uppercase AIX and proper-case Solaris but I don't have easy access to either system to check this.