X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Message-ID: <4A9AEB04.1090603@bopp.net> Date: Sun, 30 Aug 2009 16:11:32 -0500 From: Jeremy Bopp User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: pipelines with paths containing spaces References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com David Christensen wrote: > I am having trouble using pipelines with paths containing spaces: This is not technically a Cygwin-specific issue, so I'm going to try to keep this short. > 2009-08-31 01:16:50 Administrator AT p43400e ~ > $ ls -d /cygdrive/c/Documents\ and\ Settings/ | xargs ls > ls: cannot access /cygdrive/c/Documents: No such file or directory > ls: cannot access and: No such file or directory > ls: cannot access Settings/: No such file or directory Please refer to the manpage for xargs by running the following: man xargs That should explain why the path is being split. > 2009-08-31 01:16:55 Administrator AT p43400e ~ > $ ls `ls -d /cygdrive/c/Documents\ and\ Settings/` > ls: cannot access /cygdrive/c/Documents: No such file or directory > ls: cannot access and: No such file or directory > ls: cannot access Settings/: No such file or directory This happens because of the way Bash, the shell you're running, splits things into words. See the manpage for bash: man bash Look for the IFS variable's description in the Shell Variables section. The following section of the Bash manual is also good: http://www.gnu.org/software/bash/manual/html_node/Word-Splitting.html#Word-Splitting -Jeremy -- 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