delorie.com/archives/browse.cgi | search |
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: | <3BBC12B6.D4A82246@syntrex.com> |
Date: | Thu, 04 Oct 2001 09:41:42 +0200 |
From: | Pavel Tsekov <ptsekov AT syntrex DOT com> |
Organization: | Syntrex Inc. |
X-Mailer: | Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686) |
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: sed issue |
References: | <200110040707 DOT JAA02558 AT cabs40 DOT col DOT bsf DOT alcatel DOT 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |