Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!uwm.edu!linac!att!att!cbnewsd!knudsen From: knudsen@cbnewsd.att.com (michael.j.knudsen) Newsgroups: comp.os.os9 Subject: Re: SILENT ERROR exits SHell script? Keywords: OSK shell bug Message-ID: <1991Jun7.220255.13394@cbnewsd.att.com> Date: 7 Jun 91 22:02:55 GMT References: <1991Jun4.230458.25390@cbnewsd.att.com> <1991Jun5.184640.4481@wam.umd.edu> Organization: AT&T Bell Laboratories Lines: 36 In article <1991Jun5.184640.4481@wam.umd.edu>, ignatz@wam.umd.edu (Mark J. Sienkiewicz) writes: > Microware's shell exits whenever a process returns a non-zero exit code. > The exit code you are getting is 1 (or 000:001 in microware terms). This > error seems to get special treatment by not being printed, but only > if you ar executing a script. Is this weird or what? Well, I can see the special treatment of Error #001 as being forward-looking on Microware's part, in case they ever put conditional branching in their Shell (along with a few other things that are way overdue, like command-line args...) > Here are the standard exit codes for diff: > 0 no differences > 1 the two files are different > 2 some error occured OK -- sure sounds like this diff was intended for Un*x usage. Why else would it use OS9's BREAK error code? Still wondering whether the -X switch will keep the OSK script from exiting whenever the files are different. > I would also ask "Why do you have diff in a shell script?" Easy. I want to diff several file pairs, and concatenate the diffs into one master file. Whenever I make an incremental backup, using DSAVE with the -DR options, I first do a dry run and put the DSAVE generated script into a temp file, and edit it to do DIFFs between the new and old versions of the files. Thus I get a record of changes. Anyway, a command that you can't use in a script in case it actually does some real work (ie, find differences) is pretty silly. I'll try the -X in the scripyt next time. -- "What America needs is A Thousand Points When Lit..." knudsen@ihlpl.att.com