delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/30/11:19:40

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
From: "Brian Wilson" <wilson AT ds DOT net>
To: albert kao <albertkao3 AT gmail DOT com>, cygwin AT cygwin DOT com
Subject: Re: use the list of files stored in a text file and process it
Date: Thu, 30 Sep 2010 11:19:29 -0400
Message-Id: <20100930151659.M44950@ds.net>
In-Reply-To: <loom.20100929T172802-227@post.gmane.org>
References: <loom DOT 20100929T172802-227 AT post DOT gmane DOT org>
X-OriginatingIP: 57.250.242.249 (wilson)
MIME-Version: 1.0
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

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

Try something like "cat test.txt | xargs -i ls {}" or "cat test.txt | xargs -t 
ls" I suspect the first one will work for you and the second one will show you 
the command line before running the command (to help you debug in future).

Sincerely,

Brian S. Wilson


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