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

Paul Paul.Domaskis@gmail.com
Mon Sep 30 18:35:00 GMT 2013

Paul <Paul.Domaskis <at> gmail.com> writes:
> ...if I use xargs with cygpath, it doesn't [give expected results]:
>    $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.

Kenneth explained that "Tilde (~) is a shell shortcut, but you are 
bypassing the shell with $dirs | xargs, so it’s not expected to work".  To 
avoid the tildes, I successfully used:

   $dirs -l | xargs -n 1 cygpath -aw

Thanks, Kenneth!

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

More information about the Cygwin mailing list