[RFA/RFC] Problem with '!' escaping with zsh/bash/ksh

Eli Zaretskii eliz@elta.co.il
Sat May 3 08:39:00 GMT 2003


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



More information about the Gdb-patches mailing list