From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,75f8e333e081c077,start X-Google-Attributes: gid10d4db,public X-Google-ArrivalTime: 1995-03-18 11:52:05 PST Path: bga.com!news.sprintlink.net!cs.utexas.edu!natinst.com!news.dell.com!tadpole.com!uunet!news.tele.fi!news.funet.fi!news.csc.fi!news.helsinki.fi!not-for-mail From: leitner@inf.fu-berlin.de (Felix von Leitner) Newsgroups: comp.os.linux.announce Subject: "bash -c 'exit 5'" gives 127 ! Followup-To: comp.os.linux.misc Date: 18 Mar 1995 17:08:08 +0200 Organization: Freie Universitaet Berlin Sender: wirzeniu@cc.helsinki.fi Message-ID: <3ket0o$7ds@kruuna.helsinki.fi> NNTP-Posting-Host: kruuna.helsinki.fi Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Keywords: Bash, bug, exit code Hi Folks ! While trying to compile Andrew and some other large projects with huge makefile systems using /bin/sh under Linux (where /bin/sh is bash), I found this strange behaviour : $ sh -c 'exit 5' ; echo $? 127 $ This broke all makefiles using "sh -c". So I began tracing this in bash and found that it is no bug, it's a features ;) At least it looks like it was meant this way. But I find it not only strange, I find it wrong. Under all other Unixes I could try it on, it worked like expected, returning 5. Well, if somebody else wants to correct this in bash-1.14.3, this is the diff for shell.c Felix --- 1036d1035 < case EXITPROG: 1037a1037,1038 > case EXITPROG: > return last_command_exit_value; --- -- If Rush Limbaugh doesn't need a disclaimer, neither do I. "Who is General Failure and why is he reading my hard disk ?" Microsoft spel chekar vor sail, worgs grate !! -- Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov PLEASE remember Keywords: and a short description of the software.