This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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: [RFA/RFC] Problem with '!' escaping with zsh/bash/ksh


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


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