[GRASS-dev] Re: [bug #4924] (grass) missing quoted path vars in init.sh

cc grass-dev

http://intevation.de/rt/webrt?serial_num=4924

On Wed, May 09, 2007 at 01:00:44PM -0500, William Kyngesburye wrote:

One more I found - line 843. I quoted the echoed PROMPT_COMMAND for
the bash shell to get it to work:

    echo "PROMPT_COMMAND='$GISBASE/etc/prompt.sh'" >> "$bashrc"

I had to use single-quotes to get it to work. I tried escaped double-
quotes but I still got path splitting errors. I decided not to
commit this myself, in case the single quotes cause other problems
(that fine detail is beyond my shell knowledge).

Any opinions on this?

Markus

Markus Neteler wrote:

cc grass-dev

http://intevation.de/rt/webrt?serial_num=4924

On Wed, May 09, 2007 at 01:00:44PM -0500, William Kyngesburye wrote:
> One more I found - line 843. I quoted the echoed PROMPT_COMMAND for
> the bash shell to get it to work:
>
> echo "PROMPT_COMMAND='$GISBASE/etc/prompt.sh'" >> "$bashrc"
>
> I had to use single-quotes to get it to work. I tried escaped double-
> quotes but I still got path splitting errors. I decided not to
> commit this myself, in case the single quotes cause other problems
> (that fine detail is beyond my shell knowledge).

Any opinions on this?

bash parses $PROMPT_COMMAND, so you need yet another level of quoting.

I suspect that you want:

  echo PROMPT_COMMAND="\''$GISBASE/etc/prompt.sh'\'"

--
Glynn Clements <glynn@gclements.plus.com>