I have a script with works perfectly on SunOS machines with sh..
Here is a part of it which is not working on RedHat sh
while getopts t:a:D:w:r:h:p:i: name
case $name in
t) TYPE=$OPTARG;if [ "$TYPE" != "abc" -o "$TYPE" != "xy" ]
elif [ "$TYPE" = "abc" ]
elif [ "$TYPE" = "xy" ]
usage function is defined elsewhere and works fine
Now when I call the program as
./config.sh -t abc -a all .......
the -a does not get registered and nor does -p and -i
When I do
./config.sh -a all -t abc -p 5478 -i /srv/asd/casd .......
the value of -a gets registered in $TYPE but then the values of -i and -p does not get stored..
this script is working fine on a SunOS machine.. but not on RHEL
What is going wrong here? I want the script to run as
./config.sh -t xxx -a xxx .... (t first)
In SunOS the
[ "$TYPE" != "abc" -o "$TYPE" != "xy" ]
[ $TYPE -ne abc -o $TYPE -ne xy ]
This has been changed in RHEL to avoide some errors i was getting