Void Linux discussion
 help / color / mirror / Atom feed
From: Userx Xbw <use...@gmail.com>
To: Christian Neukirchen <chneuk...@gmail.com>
Cc: voidlinux <void...@googlegroups.com>
Subject: Re: changing terminal prompt when logged as su
Date: Wed, 16 Mar 2016 06:52:57 -0500	[thread overview]
Message-ID: <CA+vT7e526eGJnk9+eonLkXauVRwXF1KXc+_EwwTKvPCP7LmK4Q@mail.gmail.com> (raw)
In-Reply-To: <87shzqu3q8.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

Yes yes, Murphy's law, after posting said question, in a state of
frustration. I figured it out, leaving me that self embarrassment feeling
for having asked, when it was such a simple fix. Thanks

On Wed, Mar 16, 2016 at 5:17 AM, Christian Neukirchen <
chneuk...@gmail.com> wrote:

> Userx Xbw <use...@gmail.com> writes:
>
> > I get the # when ever I log into terminal as su
> > how do I change it to show [root@domanName]currentDir# ?
> > I've added a /etc/bashrc and this inside of it.
> >
> > #if [[ $EUID == 0 ]] ; then
> >
> > if [[ id == 0 ]] ; then
> >
> > export PS1="\[\e[41m\]\u\[\e[m\]@\[\e[41m\]\h\[\e[m\]\w# "
> >
> > else
> >  export PS1="\u@\h\w $"
> > fi
> >
> >  this only shows
> > [\u@\h:\w] $
> >
> > and changes the shell to sh no longer giving me history using the arrows
> on
> > the keyboard.
> >
> > what file and where did you (void creators) hide it so I can modify it to
> > get it to show a prompt I like more better then just #
> >
> > and why it is such a hard subject to find an answer to on the internet?
>
> Set your root shell to bash, not sh.
>
> And the test should be [[ $EUID == 0 ]].
>
> Or use '\$' in PS1 to get # or $ depending on uid.
>
> --
> Christian Neukirchen  <chneuk...@gmail.com>  http://chneukirchen.org
>

[-- Attachment #2: Type: text/html, Size: 2015 bytes --]

      reply	other threads:[~2016-03-16 11:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 17:34 Userx Xbw
2016-03-16 10:17 ` Christian Neukirchen
2016-03-16 11:52   ` Userx Xbw [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+vT7e526eGJnk9+eonLkXauVRwXF1KXc+_EwwTKvPCP7LmK4Q@mail.gmail.com \
    --to="use..."@gmail.com \
    --cc="chneuk..."@gmail.com \
    --cc="void..."@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).