This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: use the list of files stored in a text file and process it


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

$ cat test.txt | xargs -delimiter="\n" ls
xargs: Invalid input delimiter specification elimiter=\n: the delimiter must be either a single char
acter or an escape sequence starting with \.


$ cat test.txt | xargs -delimiter='\n' ls
xargs: Invalid input delimiter specification elimiter=\n: the delimiter must be either a single char
acter or an escape sequence starting with \.


$ cat test.txt | xargs -delimiter='\\n' ls
xargs: Invalid input delimiter specification elimiter=\\n: the delimiter must be either a single cha
racter or an escape sequence starting with \.


$ cat test.txt | xargs -delimiter="\\n" ls
xargs: Invalid input delimiter specification elimiter=\n: the delimiter must be either a single char
acter or an escape sequence starting with \.


$ uname -srv
CYGWIN_NT-5.1 1.7.5(0.225/5/3) 2010-04-12 19:07



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


I would also suggest that you check your filenames in test.txt to make sure, if you included paths, that they are absolute and follow the Cygwin virtual-paths (cygpath) syntax, i.e.: /cygdrive/c/... or /etc/share/... and so on. Barring that, a path in Unix notation relative to your $PWD -- or the directory where test.txt is saved -- is a good starting point (npi): something along the lines of bin/deprecated or ../man1 .

I know one of the trip-ups I often have if I spend any time away from a L/Unix environment has to do with the "mv" command: I often forget that it prefers absolute paths from root folders (or in the case of Cygwin, virtual ones taken as real) or dot-dot-slash relative path syntax to just "/god-directory/" or what-have-you. Many other commands, particularly ls and ln -s, are likewise "particular about their paths."

Steve W.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]