The UNIX and Linux Forums  

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 -->
  #3 (permalink)  
Old 10-03-2006
lweegp lweegp is offline
Registered User
  
 

Join Date: Oct 2005
Location: singapore
Posts: 107
Quote:
Originally Posted by Andrek
You could convert the input string to...
all upper case and test for uppercase Y only
all lower case and test for lowercase y on;y
use the "or" in your if statememt "$ret" != "y" || "$ret" != "Y"
Hi Andrek,

Many thanks for your contribution.

what do u mean by the following sentence:

"You could convert the input string to...
all upper case and test for uppercase Y only
all lower case and test for lowercase y only" ?

i have tried using or in my if statement but they are not giving me the expected result...actually the whole script looks like this:

echo "Do you want to execute DWH Test Program?"
echo ""
echo -n "Okay?("y" or "n")=> "
set ret = $<

if ("$ret" != "y" || "$ret" != "Y") then
echo ""
echo ""
echo "End."
exit 0
endif

echo ""
echo "---- DWH Program is running --------"
echo ""

/bin/rsh -n -l smtadm 140.32.12.34 /spsummit/apl/summit/nss_tools/scripts/test.csh >& /dev/null

Once the prog check if its Yes or No then it will either exit or execute another script.

any advise? thanks again.

wee