Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!eos!labrea!decwrl!pyramid!weitek!practic!vlsisj!bennett From: bennett@vlsisj.VLSI.COM (Michael Bennett) Newsgroups: comp.sys.apollo Subject: Re: shell scripts, boolean variables, and eon Message-ID: <2302@vlsisj.VLSI.COM> Date: 6 Apr 88 18:27:18 GMT References: <8803241941.AA09455@ELI.CS.YALE.EDU> Reply-To: bennett@vlsisj.UUCP (Michael Bennett) Organization: VLSI Technology Inc., San Jose, CA Lines: 49 In article <8803241941.AA09455@ELI.CS.YALE.EDU> hanks-steven@YALE.ARPA (Steven Hanks) writes: >executing the following shell script produces weird >results: > #!/com/sh > eon > truevar := true > falsevar := false > if ^falsevar then args "yes" else args "no" endif This line doesn't work right. (Output is 'yes') > if ((^falsevar)) then args "yes" else args "no" endif And this one does. (Output is 'no') My experiment yielded the same results. I'll bet DOMAIN/IX is interfering. In /bin are scripts called true and false which return (exit 0) and (exit 1) respectively. This works fine for /bin/csh, but not for /com/sh since the /com/sh command exit is for exiting loops, not exiting shells. Thus, when /com/sh interprets ^falsevar, it replaces it with the text 'false' (it may be arguable wether or not this is the appropriate action for a boolean variable with eon), and calls the /bin/false shell which just exits a non-existent loop and returns with a status of true. The line above with ((^falsevar)) works because after the text 'false' is substituted for ^falsevar, the expression is evaluated and returns a value of false. My discussion assumes the DOMAIN/IX /bin directory exists and is on your search path. If either of these aren't true, then maybe you have a false command somewhere else on your search path. Try this to find out where: $ sh -n -x <