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]

Unexpected results: dirs | xargs -n 1 cygpath -aw


I'm doing something wrong with xargs.  If I simply use "cygpath -aw" with 2 
arguments, it works fine:

   $cygpath -aw ~/projects/project1 ~/projects/project2

      C:\cygwin\home\Fred.Ma\projects\project1
      C:\cygwin\home\Fred.Ma\projects\project2

If I use "xargs -n 1" with echo, it works fine:

   $dirs | xargs echo

      ~/projects/project1 ~/projects/project2

   $dirs | xargs -n 1 echo

      ~/projects/project1
      ~/projects/project2

However, if I use xargs with cygpath, it doesn't:

   $dirs | xargs -n 1 cygpath -aw

      C:\cygwin\home\UserName\projects\project1\~\projects\project1
      C:\cygwin\home\UserName\projects\project1\~\projects\project2

Thanks if anyone can explain what I'm doing wrong.


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