delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/29/11:50:47

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Wed, 29 Sep 2010 11:50:15 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: use the list of files stored in a text file and process it
Message-ID: <20100929155015.GA12842@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <loom DOT 20100929T172802-227 AT post DOT gmane DOT org>
MIME-Version: 1.0
In-Reply-To: <loom.20100929T172802-227@post.gmane.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
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

On Wed, Sep 29, 2010 at 03:39:10PM +0000, albert kao wrote:
>I store a list of files in a text file (test.txt) on Windows XP.
>I want to use the list of files and process it (e.g. ls).
>What is the command to do that?
>I tried the following commands but to no avail.
>
>$ cat test.txt
>test.txt
>
>$ cat test.txt | xargs ls
>: No such file or directory

It looks like you have CRLF line endings in the file.  Run test.txt
through d2u and the above command should work.  It looks like you
can't just use xargs --delimiter since that option takes only a
single character.

So:

d2u < test.txt | xargs ls

cgf

--
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