This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: sed issue
- To: Jorge Goncalvez <goncal11 at col dot bsf dot alcatel dot fr>
- Subject: Re: sed issue
- From: Pavel Tsekov <ptsekov at syntrex dot com>
- Date: Thu, 04 Oct 2001 09:41:42 +0200
- CC: cygwin at sources dot redhat dot com
- Organization: Syntrex Inc.
- References: <200110040707.JAA02558@cabs40.col.bsf.alcatel.fr>
Jorge Goncalvez wrote:
>
> Hi, I have this code:
> sprintf(buf, "arp -d %s; arp -s %s %s ",
> a, a, print_hw_addr(htype, hlen, haddr));
>
>
> What I wanted to do is to take the third %s which is like this:
> XX:XX:XX:XX:XX:XX to tranform it like this
> XX-XX-XX-XX-XX-XX
>
> I tried this:
>
> sprintf(buf, "arp -d %s; arp -s %s `echo %s | sed -g s/:/-/`",
> a, a, print_hw_addr(htype, hlen, haddr));
>
> But it didn't work why?
Do you pass the "buf" to a "system" or "execxx" call or
you just exepect the buffer to be filled with the appropriate
info after the "sprintf" ?
--
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/