Mailinglist Archive: opensuse-factory (175 mails)

< Previous Next >
Re: [opensuse-factory] chrooted factory question
  • From: "Carlos E. R." <robin.listas@xxxxxxxxxxxxxx>
  • Date: Tue, 22 Jul 2008 12:15:39 +0200 (CEST)
  • Message-id: <alpine.LSU.1.00.0807221204190.5936@xxxxxxxxxxxxxxxx>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



The Tuesday 2008-07-22 at 08:23 +0200, Peter Czanik wrote:

The command prompt is set at the start of the shell, so a later host name change does not help here. But you can change the prompt later any time. The variable in question is PS1:

czanik@bigone:~> set | grep PS1
PS1='$(ppwd \l)\u@\h:\w> '
czanik@bigone:~> export PS1='$(ppwd \l)\u@unstable:\w> '
czanik@unstable:~>

Your friend is 'man bash', and search for 'PROMPTING'.

Ah! Good. Tried that, worked, but lost the red color. So I found the original PS1 (10.3) and changed it thus:

nimrodel:/ # export PS1=$'\\[\E[1m\E[31m\\]NOT_\\h:\\w # \\[\E(B\E[m\\]'
NOT_nimrodel:/ #

which is a good enough approximation to what I want, thanks. I wrote it as a comment in my script before the chroot command, because after it, it doesn't execute (and I don't want to change the profile or bashrc):

echo
echo " Copy paste the next line to activate prompt change:"
echo "export PS1=$'\\[\E[1m\E[31m\\]NOT_\\h:\\w # \\[\E(B\E[m\\]'"
echo
chroot /otros/test_d/ /bin/bash --login


So thanks, and thanks also to Volker for the "login" hint.


- -- Cheers,
Carlos E. R.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)

iD8DBQFIhbNMtTMYHG2NR9URArF7AJwKxS51shTTel4NaMrCtCJUyH1nFACeIDrh
DQR1rNyU46ySZm+5S2XkhMk=
=NFZg
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-factory+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups