delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/01/05/17:58:33

X-Spam-Check-By: sourceware.org
Message-ID: <20060105225825.39736.qmail@web53412.mail.yahoo.com>
Date: Thu, 5 Jan 2006 14:58:25 -0800 (PST)
From: Dave <d_inabox AT yahoo DOT com>
Subject: Re: chere problem with directories with single quote marks
To: cygwin AT cygwin DOT com
Cc: Eric Blake <ebb9 AT byu DOT net>
In-Reply-To: <43BBD542.90604@byu.net>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--- Eric Blake wrote:

> According to Dave on 1/3/2006 2:03 PM:
> >>
> >>the here-doc correctly preserved the input string.  So applying that to
> >>the above problem, the registry entry MIGHT work (untested by me) if it is
> >>written as:
> >>
> >>SHELL_CMD="-l -c \\\"xargs -0 cd << 'EOF'\n%L\nEOF\nexec $SHELL_EXE\\\""
> > 
> > 
> > Hmmm. It appears that I haven't handled this case consistently. I'll have a
> look
> > at getting both ' and $ to work properly.
> 
> Scratch my above example; cd is a shell builtin, so it won't work from

<snip>

Thanks for trying things, but...

The original poster is using the -1 option which attempts to get to the
appropriate directory without executing the intermediate script (xhere). As
you've seen this has problems with quoting which are unique to each of the
shells, since it is the shell that is evaluating the argument. This method also
has problems accessing network paths and starting ash and tcsh as noted on the
man page.

I've tested the other start option (-2), and that correctly goes to the path
"\\Minime\$@dave's `stuff". That contains an apostrophe, a backtick and what
could be interpreted as a shell parameter, all on a network path. I'm not
entirely sure why this works, but I suspect it has to do with the lack of
recursive parameter expansion. But don't quote me on that :)

Since the single quotes prevent shell expansion and things, I think that they
are most appropriate for the -1 option. I will note the limitation on entering
directories containing apostrophes in the man page.

The -2 option is the default, so I don't see this being a major issue.


Regards,

Dave.


		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019