This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA/RFC] Problem with '!' escaping with zsh/bash/ksh
- From: "Eli Zaretskii" <eliz at elta dot co dot il>
- To: brobecker at gnat dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sat, 03 May 2003 11:36:01 +0300
- Subject: Re: [RFA/RFC] Problem with '!' escaping with zsh/bash/ksh
- References: <20030502233458.GP992@gnat.com>
- Reply-to: Eli Zaretskii <eliz at elta dot co dot il>
> Date: Fri, 2 May 2003 16:34:58 -0700
> From: Joel Brobecker <brobecker@gnat.com>
>
> the following change introduced a problem when forking inferiors when
> the path to the executable contains '!' characters. This only occurs
> with sh-like shells, like zsh/bash/ksh. I have reproduced this on Linux
> and HP/UX.
>
> * fork-inferior.c (fork_inferior): Add '!' to the list of
> characters that need to be quoted when building a string for the
> shell. Quote '!' specifically with a backslash, since CSH chokes
> when trying to evaluate "str!str".
>
> Witness:
>
> (gdb) run
> Starting program: /home/brobecke/tmp/GEO_ENV!9.159/foo
> zsh: no such file or directory: /home/brobecke/tmp/GEO_ENV\!9.159/foo
>
> Program exited with code 01.
> You can't do that without a process to debug.
>
> As far as I can tell from the comments in fork_inferior and my own
> experiments, the bang should be escaped only for C shells.
Are you saying that zsh doesn't support escaping of arbitrary
characters with a backslash? That is, under zsh, "\a" is not the same
as "a"? I'd be surprised.