Void Linux discussion
 help / Atom feed
* changing terminal prompt when logged as su
@ 2016-03-15 17:34 Userx Xbw
  2016-03-16 10:17 ` Christian Neukirchen
  0 siblings, 1 reply; 3+ messages in thread
From: Userx Xbw @ 2016-03-15 17:34 UTC (permalink / raw)
  To: voidlinux

[-- Attachment #1.1: Type: text/plain, Size: 633 bytes --]

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? 



[-- Attachment #1.2: Type: text/html, Size: 750 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: changing terminal prompt when logged as su
  2016-03-15 17:34 changing terminal prompt when logged as su Userx Xbw
@ 2016-03-16 10:17 ` Christian Neukirchen
  2016-03-16 11:52   ` Userx Xbw
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Neukirchen @ 2016-03-16 10:17 UTC (permalink / raw)
  To: Userx Xbw; +Cc: voidlinux

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: changing terminal prompt when logged as su
  2016-03-16 10:17 ` Christian Neukirchen
@ 2016-03-16 11:52   ` Userx Xbw
  0 siblings, 0 replies; 3+ messages in thread
From: Userx Xbw @ 2016-03-16 11:52 UTC (permalink / raw)
  To: Christian Neukirchen; +Cc: voidlinux

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-15 17:34 changing terminal prompt when logged as su Userx Xbw
2016-03-16 10:17 ` Christian Neukirchen
2016-03-16 11:52   ` Userx Xbw

Void Linux discussion

Archives are clonable: git clone --mirror http://inbox.vuxu.org/voidlinux

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.voidlinux


AGPL code for this site: git clone https://public-inbox.org/ public-inbox