From owner-freebsd-bugs Sun Mar 16 10:10:16 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D1FA637B401 for ; Sun, 16 Mar 2003 10:10:13 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2341243F93 for ; Sun, 16 Mar 2003 10:10:12 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h2GIABNS045075 for ; Sun, 16 Mar 2003 10:10:11 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h2GIAB9d045074; Sun, 16 Mar 2003 10:10:11 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A63D37B404 for ; Sun, 16 Mar 2003 10:06:58 -0800 (PST) Received: from net2.dinoex.sub.org (net2.dinoex.de [212.184.201.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D5D243FBF for ; Sun, 16 Mar 2003 10:06:55 -0800 (PST) (envelope-from pmc@citylink.dinoex.sub.org) Received: from net2.dinoex.sub.org (uucp@net2.dinoex.de [212.184.201.182]) by net2.dinoex.sub.org (8.12.8/8.12.8) with ESMTP id h2GI6jmo003358 for ; Sun, 16 Mar 2003 19:06:47 +0100 (CET) (envelope-from pmc@citylink.dinoex.sub.org) Received: from citylink.dinoex.sub.org (uucp@localhost) by net2.dinoex.sub.org (8.12.8/8.12.8/Submit) with UUCP id h2GI6iWR003357 for freebsd.org!FreeBSD-gnats-submit; Sun, 16 Mar 2003 19:06:44 +0100 (CET) (envelope-from pmc@citylink.dinoex.sub.org) Received: from citylink.dinoex.sub.de by citylink.dinoex.sub.org (8.8.5/PMuch-B3b) with ESMTP id OAA05636 for ; Sun, 16 Mar 2003 14:00:27 +0100 (CET) Received: from gate.oper.dinoex.org (localhost [127.0.0.1]) by citylink.dinoex.sub.de (8.12.6/8.12.6) with ESMTP id h2GD2ekO064568 for ; Sun, 16 Mar 2003 14:02:40 +0100 (CET) (envelope-from pmc@disp.oper.dinoex.org) Received: from disp.oper.dinoex.org (disp-e [192.168.98.5]) by gate.oper.dinoex.org (8.12.6/8.12.6) with ESMTP id h2GD1abN064562 for ; Sun, 16 Mar 2003 14:01:37 +0100 (CET) (envelope-from pmc@disp.oper.dinoex.org) Received: (from pmc@localhost) by disp.oper.dinoex.org (8.11.6/8.11.6) id h2GD19e62827; Sun, 16 Mar 2003 14:01:09 +0100 (CET) (envelope-from pmc) Message-Id: <200303161301.h2GD19e62827@disp.oper.dinoex.org> Date: Sun, 16 Mar 2003 14:01:09 +0100 (CET) From: Peter Much Reply-To: Peter Much To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/50051: /bin/sh: child termination signals break valid shellscripts Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 50051 >Category: bin >Synopsis: /bin/sh: child termination signals break valid shellscripts >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Mar 16 10:10:11 PST 2003 >Closed-Date: >Last-Modified: >Originator: Peter Much >Release: FreeBSD 4.7-RELEASE i386 >Organization: n/a >Environment: System: FreeBSD gate.oper.dinoex.org 4.7-RELEASE FreeBSD 4.7-RELEASE #0: Fri Dec 27 23:08:12 CET 2002 root@dyn.oper.dinoex.org:/u/4-STABLE/obj/u/4-STABLE/src/sys/G1R47V1 i386 /bin/sh >Description: An executable gets terminated by signal. /bin/sh will report the name of the signal not only to its stdout, but will also insert this text in the stdout of the next subshell. >How-To-Repeat: 1. Run /bin/sh 2. Enter the command: sleep 30; test `ls | wc -l` -gt 0 3. Kill the "sleep" process with the kill command from some other tty. You will then see the "test" command failing with syntax error. When activating -x you will see the signal name being added to the output from "wc": + sleep 30 + wc -l + ls + test 133 Terminated -gt 0 Terminated test: 133: unexpected operator >Fix: Bernd Walter came up with the following suggestion. It seems to suit as a workaround: trap "wait" 20 >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message