From mboxrd@z Thu Jan 1 00:00:00 1970 X-Received: by 10.50.43.170 with SMTP id x10mr3040083igl.8.1458129178227; Wed, 16 Mar 2016 04:52:58 -0700 (PDT) X-BeenThere: voidlinux@googlegroups.com Received: by 10.140.23.212 with SMTP id 78ls918748qgp.65.gmail; Wed, 16 Mar 2016 04:52:57 -0700 (PDT) X-Received: by 10.140.43.75 with SMTP id d69mr2403338qga.5.1458129177562; Wed, 16 Mar 2016 04:52:57 -0700 (PDT) Return-Path: Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com. [2607:f8b0:4003:c01::230]) by gmr-mx.google.com with ESMTPS id ph8si2150206igb.0.2016.03.16.04.52.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 04:52:57 -0700 (PDT) Received-SPF: pass (google.com: domain of use...@gmail.com designates 2607:f8b0:4003:c01::230 as permitted sender) client-ip=2607:f8b0:4003:c01::230; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of use...@gmail.com designates 2607:f8b0:4003:c01::230 as permitted sender) smtp.mailfrom=use...@gmail.com; dkim=pass head...@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Received: by mail-ob0-x230.google.com with SMTP id fp4so48118641obb.2 for ; Wed, 16 Mar 2016 04:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=NBdBVWKtLQrJlWwuqajovvAHsQp34kaTaSiWzrLRqMw=; b=awvQCPyRUhJHUvHId+P8jdOYyO1ddXaG+FmARNekO//cfOz605QNIu4Tzmvix1kHOb mphBU2APQ4cpAD2RFztnJ1PHraDnJpMUY3cu0+Iust5xqd0sUYGv8xqoq4CrBrrUNJNA F1uxuk3gfaEXCmXFiSprJP9AMZfU7H8+9aXfiu2SxMZe5mVhbo0g2qVHDyjZJF0jx8sO sAB/cLCWA33mbQJuJI3Wm+TiSGk7YBQU+eGG/4Fa1k+aoCdW+akL07hlewDhbXNOr5g9 MFqLT6W0jMK0hfmyPfJAzQgr34XZBbtCpmIWf/OMAFgAN1SFu/iJOeSVgihCMw2YeoWp CCuw== X-Gm-Message-State: AD7BkJKa1o+p+3GVDY6kpC1E7Vw2fGllJHDG7SdoGO6kv2FRQQMJ/U/4Fo5ishg+dc0edoMuLQsm/dUqruZ4Ng== MIME-Version: 1.0 X-Received: by 10.60.35.163 with SMTP id i3mr2085403oej.36.1458129177119; Wed, 16 Mar 2016 04:52:57 -0700 (PDT) Received: by 10.202.58.86 with HTTP; Wed, 16 Mar 2016 04:52:57 -0700 (PDT) In-Reply-To: <87shzqu3q8.fsf@gmail.com> References: <87shzqu3q8.fsf@gmail.com> Date: Wed, 16 Mar 2016 06:52:57 -0500 Message-ID: Subject: Re: changing terminal prompt when logged as su From: Userx Xbw To: Christian Neukirchen Cc: voidlinux Content-Type: multipart/alternative; boundary=089e0118427aa3b6ff052e292790 --089e0118427aa3b6ff052e292790 Content-Type: text/plain; charset=UTF-8 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 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 http://chneukirchen.org > --089e0118427aa3b6ff052e292790 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yes yes, Murphy's law, after posting said question, in= a state of frustration. I figured it out, leaving me that self embarrassme= nt 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 <<= a href=3D"mailto:use...@gmail.com">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 =3D=3D 0 ]] ; then
>
> if [[ id =3D=3D 0 ]] ; then
>
> export PS1=3D"\[\e[41m\]\u\[\e[m\]@\[\e[41m\]\h\[\e[m\]\w# "=
>
> else
>=C2=A0 export PS1=3D"\u@\h\w $"
> fi
>
>=C2=A0 this only shows
> [\u@\h:\w] $
>
> and changes the shell to sh no longer giving me history using the arro= ws 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 =3D=3D 0 ]].

Or use '\$' in PS1 to get # or $ depending on uid.

--
Christian Neukirchen=C2=A0 <chneu= k...@gmail.com>=C2=A0 http://chneukirchen.org

--089e0118427aa3b6ff052e292790--