delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/10/04/12:10:59

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3BBC88CA.910D0123@cportcorp.com>
Date: Thu, 04 Oct 2001 12:05:30 -0400
From: Peter Buckley <peter DOT buckley AT cportcorp DOT com>
X-Mailer: Mozilla 4.7 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Jorge Goncalvez <goncal11 AT col DOT bsf DOT alcatel DOT fr>
CC: cygwin AT sources DOT redhat DOT com
Subject: Re: System issue
References: <200110040922 DOT LAA13370 AT cabs40 DOT col DOT bsf DOT alcatel DOT fr>

I don't know what the problem is- 
I tried this part of the command in a 
bash shell- 

echo 00:80:9f:04:36:13 | sed -e s/:/-/g

And it worked as expected-

00-80-9f-04-36-13

I also tried it without the "-e" option- 

echo 00:80:9f:04:36:13 | sed s/:/-/g

And it worked as expected-

00-80-9f-04-36-13

So your problem isn't with sed, it must be something 
else- I admit, I really don't know all of 
what is going on in that sprintf, but I would guess 
it might be a quoting problem.

HTH,
Peter

Jorge Goncalvez wrote:
> 
> Hi I have a system issue in fact i have this code:
>  note("SET ARP (system)\n");
> 
>  a = inet_ntoa(*ia);
>  sprintf(buf, "arp -d %s; arp -s %s `echo %s | sed -e s/:/-/g`",
>                    a, a, print_hw_addr(htype, hlen, haddr));
> 
>  status = system(buf);
> 
> And the output is:
> 
>  arp -d 192.40.54.42; arp -s 192.40.54.42 `echo 00:80:9f:04:36:13 | sed -e
> s/:/-/g`
> 
>  And I wanted to do is to interpret my sed command that seems to ne not
> onterpreted
>  I wanted to tranform the third %s it is like that:xx:xx:xx:xx:xx:xx to
> xx-xx-xx-xx-xx-xx
> 
>  Thanks.
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

-- 
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now?  [OK]

--

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019