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: cp: omitting directory, for copying only files, sed


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


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