delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/11/07/08:22:35

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.6 required=5.0 tests=AWL,BAYES_50,SARE_HELO_EQ_CUST,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: David <dbj AT vip DOT cybercity DOT dk>
Subject: Re: cp: omitting directory, for copying only files, sed
Date: Sun, 07 Nov 2010 14:22:02 +0100
Lines: 22
Message-ID: <ib695r$uer$1@dough.gmane.org>
References: <ib3gtb$v4$1 AT dough DOT gmane DOT org> <6488B010-E946-4EA3-BE77-586ACD794EEB AT edgar-matzinger DOT nl>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; da; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1
In-Reply-To: <6488B010-E946-4EA3-BE77-586ACD794EEB@edgar-matzinger.nl>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Den 06-11-2010 15:12, Edgar Matzinger skrev:
> I ran this script (on MacOSX):
>
> #!/bin/sh
> W="\/Users\/edgarm\/tmp\/$1\/."
> echo $W
> sed -n 's/^File[ ]*\([^ ][^ ]*\).*/\"\1\" '"$W"'/p' < $2 | xargs echo X:
>
> And this is the output...
>
> tmp$ ./cptest1 test list.txt
> \/Users\/edgarm\/tmp\/test\/.
> X: ..\test\file1.txt /Users/edgarm/tmp/test/. ..\test\file2.txt
> /Users/edgarm/tmp/test/.
>
> See the problem?

Oh I see the light

xargs -n2 echo X:

will do the trick


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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