Re: Bash not escaping escape sequences in directory names
From:
Andreas Kusalananda Kähäri
Subject:
Re: Bash not escaping escape sequences in directory names
Date:
Mon, 24 Jan 2022 22:01:11 +0100
On Tue, Jan 25, 2022 at 02:24:26AM +0700, Robert Elz wrote:
> Date: Mon, 24 Jan 2022 19:53:03 +0100
> From: Andreas Kusalananda =?utf-8?B?S8OkaMOkcmk=?=
> <andreas.kahari@abc.se>
> Message-ID: <Ye71jwgBhenC33RD@box>
>
> | Why would people want it to do that (i.e. export PS1)?
>
> It isn't exporting PS1 that's the issue, it is importing it. And that
> I rely on quite frequently. (Of course, it has to be exported by something
> to be imported elsewhere - which gives the reason why one would want to
> export PS1).
>
> Eg: I am often working with several variants of the same basic shell
> (various bug fixes, or attempts at them, or new features being developed)
> and I want to get some hint of which variant I have running in some particular
> window, so when I run test code, and it works, or doesn't, I know which
> variant did what).
>
> To do that, given that they are 99.9% identical shells (including all startup
> scripts etc) I just do
>
> PS1='bugfix1 $ ' /path/to/shell1
> PS1='newfeat $ ' /path/to/shell2
> PS1='standard$ ' /bin/sh
>
> (in different windows, one for each, of course), then however I move
> the windows around, or whatever else I do (aside from changing PS1
> obviously) I always know which variant is running.
>
> If a shell refused to import PS1, this wouldn't work.
>
> kre
>
>
This, together with Chet's and Greg's mail; All around good and
reasonable things said by people I trust to say sensible things about
the shell. Thanks. I'll stand down from my "you need to do something
right now" position.
Take care,
--
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden
.