From owner-freebsd-bugs@FreeBSD.ORG Sat Jun 14 11:20:21 2003 Return-Path: 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 EAE7B37B401 for ; Sat, 14 Jun 2003 11:20:21 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8906D43FAF for ; Sat, 14 Jun 2003 11:20:21 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h5EIKLUp058175 for ; Sat, 14 Jun 2003 11:20:21 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h5EIKL6L058174; Sat, 14 Jun 2003 11:20:21 -0700 (PDT) Date: Sat, 14 Jun 2003 11:20:21 -0700 (PDT) Message-Id: <200306141820.h5EIKL6L058174@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Martin Kaeske Subject: Re: bin/52743: /etc/ppp/ppp.linkup instability issues X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Martin Kaeske List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jun 2003 18:20:22 -0000 The following reply was made to PR bin/52743; it has been noted by GNATS. From: Martin Kaeske To: Felipe Gasper , freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: bin/52743: /etc/ppp/ppp.linkup instability issues Date: Sat, 14 Jun 2003 20:13:26 +0200 On Sat, Jun 14, 2003 at 11:07:22AM -0500, Felipe Gasper wrote: > But that doesn't explain why I thought you've had a problem with ppp not initiating the network connection properly, did i misunderstood you? > ! sh -c "/sbin/ifconfig tun0 | /usr/bin/grep inet | /usr/bin/awk '{print > $2}' | mail -s 'New IP' root" > > locks the script up and > > ! sh -c "/sbin/ifconfig tun0 | /usr/bin/mail -s 'New IP' root" > > doesn't, am I right? > > I have noticed, though, that if I create a shell script that contains only > the first line (ifconfig | grep | awk), it seems to ignore the awk command, > outputting the output of the grep command. If I take out the sh -c and > double quotes, though, it works....maybe completely unrelated, quite > possibly something that I'm doing wrong, but ....? What do you mean by "locks the script up"? I tried this on my machine and it didn't lock ppp but i can confirm that the results are wrong. It seems that the awk command is ignored, in fact awk is executed but its parameter is wrong. The shell inserts the value of variable "$2" since this variable isn't set the resulting string is "awk {print}" that's why it looks like awk isn't called at all. I'm still investigating why this happens, it has something to do with nested quotes ("foo '$bar' foo"). I'll submit a followup to this PR if I know wether this is desired behaviour or not. To circumvent the problem you can write {print\$2} instead, that worked for me. So long Martin -- The instructions said to use Windows 98 or better, so I installed FreeBSD. -- Jim Levie in comp.unix.bsd.freebsd.misc --