Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jun 2003 11:20:21 -0700 (PDT)
From:      Martin Kaeske <Martin.Kaeske@Stud.TU-Ilmenau.DE>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/52743: /etc/ppp/ppp.linkup instability issues
Message-ID:  <200306141820.h5EIKL6L058174@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/52743; it has been noted by GNATS.

From: Martin Kaeske <Martin.Kaeske@Stud.TU-Ilmenau.DE>
To: Felipe Gasper <fgasper@uiuc.edu>,
	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 --



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306141820.h5EIKL6L058174>