Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!usc!orion.cf.uci.edu!uci-ics!zardoz!tgate!ka3ovk!drilex!axiom!insyte!m2 From: m2@insyte (Mike Arena) Newsgroups: news.software.b Subject: Case statements in Bourne shell Message-ID: <1989Jun21.180116.18294@insyte> Date: 21 Jun 89 18:01:16 GMT Organization: Innovative Systems Techniques (INSYTE) Lines: 26 On HP-UX, it seems that the case statement doesn't function correctly. (Or, at least, not the same way it is used in the C news scripts.) The problem is with case statements of the form: case "$foo" in "") ... *) ... esac If the variable foo is not set or is null then the first choice ("") should fire but it doesn't. If you change the first line to: case $foo in then it works!?!?! I changed all of the files in /bin and $NEWSBIN so that they work. However, I would like to know if our Bourne shell is broken or if the scripts are written incorrectly. By the way, the following produces the correct result: if [ "$foo" = "" ] then echo "It works" fi -- Michael J. Arena (617) 965 8450 | UUCP: ...harvard!linus!axiom!insyte!m2 Innovative Systems Techniques | ...harvard!necntc!lpi!insyte!m2 1 Gateway Center, Newton, MA 02158 | ARPA: insyte!m2@harvard.harvard.edu