On Mon  2 Apr 2018 at 09:25:57 -0700, Ian Zimmerman wrote:
> Ah, this is a comedy of errors.  You've missed my intended point, which
> was wrong; but now I see the real problem.
> 
> I missed the outermost single quotes in your echo command, so I thought
> the parent shell would strip the double quotes and then the child shell
> would see unquoted whitespace on the right side of the export.

  All of this  because of one Rube Goldberg  device ...  At least we are
converging to understanding each other.

> But the real problem is that quotes (either kind by itself or mixed) do
> not nest.  So the first single quote will be paired with the one before
> $HOST and terminated by it; and the double quote after = will remain
> unbalanced and unterminated. 

  That is exactly what I meant to do,  and I admit it is rather kludgey.
Because of the single quotes, which are around everything but $HOST, the
double quotes are literally echoed.  The  child shell will therefore see
the PS1 definition surrounded by double quotes.  The echo part should be
equivalent to this, which may be clearer:

    echo "export PS1=\"(chroot $HOST) \$PS1\"; exec <dev/tty"

  For the record,  my  original Goldberg device works  for me.  /How/ it
works is another question, on which we will hopefully reach consensus at
some point.

<ot>
    > And now I learn, at last, that Bas is the Dutch nickname for Sebastiaan.
    > Thanks for that ;-)

      There is also Bastiaan and Sebas.  Note that a short form can also
    be  someone’s official  given name,  and  that ‘nicknames’  are more
    formal in Dutch than in most languages.  Many nicknames are given at
    birth  and  used in  both  formal  and  informal  social situations.
    Calling someone by a different nickname or their full name might not
    be appreciated.  Not everyone has a nickname.
      Not every Bas is a Sebastiaan and not every Sebastiaan is a Bas.
</ot>

                                                              Sincerely,

                                                                 Bas

-- 
Sebastiaan L. Zoutendijk | slzoutend...@gmail.com

Reply via email to