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]

Re: chere problem with directories with single quote marks


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]