Subject: RE: pipelines with paths containing spaces
From: "David Christensen" <[email-masked]>
To: <[email-masked]>
Cc: "'Marco Atzeri'" <[email-masked]>
Date: Mon, 31 Aug 2009 04:26:39 -0700
List-Id: <cygwin.cygwin.com>

Marco Atzeri wrote:
> not really cygwin specific 
> find /cygdrive/c/Documents\ and\ Settings/ -print0 |xargs --null ls
> see  "man xargs"

That explains it.  Here's a work-around:

    2009-08-31 04:04:36 dpchrist@p43400e ~
    $ ls -d /cygdrive/c/Documents\ and\ Settings/ | perl -ne 's/\n/\00/;
 print' | xargs -0 ls -dl
    drwxrwxr-x+ 9 Administrators SYSTEM 0 Aug 30 01:19 /cygdrive/c/Docum
ents and Settings/

Add the Perl one-liner to my .bashrc as an alias:

    2009-08-31 04:14:45 dpchrist@p43400e ~
    $ vi .bashrc
    alias nl2null="perl -ne 's/\n/\00/; print'"

Life is good!

    2009-08-31 04:16:03 dpchrist@p43400e ~
    $ ls -d /cygdrive/c/Documents\ and\ Settings/ | nl2null | xargs -0 l
s -dl
    drwxrwxr-x+ 9 Administrators SYSTEM 0 Aug 30 01:19 /cygdrive/c/Docum
ents and Settings/

Thanks!  :-)

David

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