This is the mail archive of the
mailing list for the Cygwin project.
Re: chere problem with directories with single quote marks
- From: Eric Blake <ebb9 at byu dot net>
- To: Tom Plunket <tomas at fancy dot org>
- Cc: cygwin at cygwin dot com
- Date: Sat, 24 Dec 2005 07:59:37 -0700
- Subject: Re: chere problem with directories with single quote marks
- References: <email@example.com>
-----BEGIN PGP SIGNED MESSAGE-----
According to Tom Plunket on 12/23/2005 11:48 PM:
> SHELL_CMD="-l -c \\\"cd '%L'; exec $SHELL_EXE\\\""
> As you can see, this is clearly "wrong" for folders with a
> single-quote mark in them.
> My local fix was just to edit the registry and change '%L' to "%L".
> Obviously this affects the handling of this feature with folders that
> have a double-quote mark in them, but as I only use single quotes
> (e.g. "Debbie's Truck" or "Craig's List"), it Works For Me. ;)
Window's allows ' but not " in filenames. However, Windows also allows $
in filenames, so switching to double quotes would trade the problems with
' to problems with $. And you need quoting, or spacing would be
corrupted. Off the top of my head, I can only think of one way that might
preserve ', $, and spaces in the problematic %L when dumped literally into
a shell script, but I don't know if Windows SHELL_CMD can handle embedded
newlines. In a normal shell window,
$ xargs -0 << 'EOF'
> a '$b
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
SHELL_CMD="-l -c \\\"xargs -0 cd << 'EOF'\n%L\nEOF\nexec $SHELL_EXE\\\""
Life is short - so eat dessert first!
Eric Blake firstname.lastname@example.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html