Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stupid PS1

11 views
Skip to first unread message

no.to...@gmail.com

unread,
Apr 27, 2012, 1:25:37 AM4/27/12
to
You get the most effect by optimising the highest-determinant.
Eg. your health is a very 'high' determinat of your life-quality.
A high determinant of computer-useability MUST be the
mnemonic value of the <prompt>.
"localhost:/etc#" is VERY lame as a prompt.
WTF is the value of the "localhost:" taking up space every time?
Why don't package-builders optimise/fix this absurdity [for PC
users, not networked users: the majority; or give a notification]?

I went through this time-wasting-exercise some years ago,
on RH & Slak family installations [we must resists tribalism],
and this PC currently shows the console-prompt as:
<user>"@28"<pwd>
which is great. I'm guessing that "@28" is the console
number; but the <pwd> is really what you want to know.

I can't fix this damned debian thing!

OK, /root/.profile does it for THAT user.
But where's the global setting?
/etc/profile doesn't do it.

PS I'm not just looking for a solution to my current little
problem, but for a global tune-up of GNU/linux. And IMO
apeing M$ with bouncing cartoons is the wrong way.

unruh

unread,
Apr 27, 2012, 1:48:06 AM4/27/12
to
On 2012-04-27, no.to...@gmail.com <no.to...@gmail.com> wrote:
> You get the most effect by optimising the highest-determinant.
> Eg. your health is a very 'high' determinat of your life-quality.
> A high determinant of computer-useability MUST be the
> mnemonic value of the <prompt>.
> "localhost:/etc#" is VERY lame as a prompt.
> WTF is the value of the "localhost:" taking up space every time?
> Why don't package-builders optimise/fix this absurdity [for PC
> users, not networked users: the majority; or give a notification]?
>

Well, most of us do not give hostname "localhost" to our machines. And
many of us have more than one machine that we log onto, each with a
hostname. Thus my PS1 prompt is
PS1='\h:${PD}[\u]>'
to tell me not only which host I am logged onto but also what the
"Display" is, to tell me how deeply I am burried. (I tend to keep doing
ssh myownmachine
because myownmachine is what I so often log into remotely that my
fingers automaticlaly do that. Then I have no idea how many loayers deep
I am. If I am onthe machine itself, the bottom layer is always 0, and I
know I have to keep hitting exit to get out of one of the layers of ssh
I am burried in.
Your milage may vary. PUt whatever you want into your PS1-- that is why
it is a user defined variable.

You really must have very little trouble in your life if the default PS1
is all you have to complain about.




> I went through this time-wasting-exercise some years ago,
> on RH & Slak family installations [we must resists tribalism],
> and this PC currently shows the console-prompt as:
><user>"@28"<pwd>
> which is great. I'm guessing that "@28" is the console
> number; but the <pwd> is really what you want to know.
>
> I can't fix this damned debian thing!
>
> OK, /root/.profile does it for THAT user.
> But where's the global setting?
> /etc/profile doesn't do it.

~/.bashrc is where I define it.


>
> PS I'm not just looking for a solution to my current little
> problem, but for a global tune-up of GNU/linux. And IMO
> apeing M$ with bouncing cartoons is the wrong way.

What has that to do with the value of PS1?
And what makes you thing that your wants and desires are universal?



>

Chris Davies

unread,
Apr 27, 2012, 3:58:54 AM4/27/12
to
In comp.os.linux.misc unruh <un...@invalid.ca> wrote:
> Well, most of us do not give hostname "localhost" to our machines. And
> many of us have more than one machine that we log onto, each with a
> hostname.

I'm also in this situation (having a number of distinct systems). But
I'm curious to know whether there is any way, other than a straw poll,
of determining a significant majority view.


> On 2012-04-27, no.to...@gmail.com <no.to...@gmail.com> wrote:
>> But where's the global setting? [for PS1]

You can tweak to your heart's content within /etc/bash.bashrc,
/etc/profile, and /etc/profile.d/. On Debian, the initial value of PS1
is set in /etc/bash.bashrc.


>> PS I'm not just looking for a solution to my current little
>> problem, but for a global tune-up of GNU/linux. And IMO
>> apeing M$ with bouncing cartoons is the wrong way.

If you explain which bits you want to tweak, I'm sure someone here will
be able to point you in the right direction.

Chris

Richard Kettlewell

unread,
Apr 27, 2012, 4:07:30 AM4/27/12
to
no.to...@gmail.com writes:
> OK, /root/.profile does it for THAT user.
> But where's the global setting?
> /etc/profile doesn't do it.

You need to read and understand the INVOCATION section of the Bash man
page.

--
http://www.greenend.org.uk/rjk/

The Natural Philosopher

unread,
Apr 27, 2012, 7:42:45 AM4/27/12
to
Chris Davies wrote:
> In comp.os.linux.misc unruh <un...@invalid.ca> wrote:
>> Well, most of us do not give hostname "localhost" to our machines. And
>> many of us have more than one machine that we log onto, each with a
>> hostname.
>
> I'm also in this situation (having a number of distinct systems). But
> I'm curious to know whether there is any way, other than a straw poll,
> of determining a significant majority view.
>

I doubt it. Its your shell variabler to set to whatever you please so
its the way YOU like it.

Mine is 'shorthost:currentdirectorypath$ or # if its root.

>
>> On 2012-04-27, no.to...@gmail.com <no.to...@gmail.com> wrote:
>>> But where's the global setting? [for PS1]
>
> You can tweak to your heart's content within /etc/bash.bashrc,
> /etc/profile, and /etc/profile.d/. On Debian, the initial value of PS1
> is set in /etc/bash.bashrc.
>
>
>>> PS I'm not just looking for a solution to my current little
>>> problem, but for a global tune-up of GNU/linux. And IMO
>>> apeing M$ with bouncing cartoons is the wrong way.
>
> If you explain which bits you want to tweak, I'm sure someone here will
> be able to point you in the right direction.
>
> Chris


--
To people who know nothing, anything is possible.
To people who know too much, it is a sad fact
that they know how little is really possible -
and how hard it is to achieve it.

notbob

unread,
Apr 27, 2012, 8:07:44 AM4/27/12
to
On 2012-04-27, no.to...@gmail.com <no.to...@gmail.com> wrote:
> You get the most effect by......

You get the most effect by RTFM!

http://tldp.org/HOWTO/Bash-Prompt-HOWTO/


I put this in my /home/[user]/bash_profile file:

export PS1='\[\033[36m\]\u \w>\[\033[m\]'

The prompt is cyan and indicates user and path


I put this in my /root/.bash_profile file:

export PS1='\[\033[1;31m\]\u \w>\[\033[m\]'

The prompt is magenta and indicates root and path.

HTH
nb

--
vi --the heart of evil!
"Avenge me!" --Bill Burr

J G Miller

unread,
Apr 27, 2012, 8:15:56 AM4/27/12
to
On Friday, April 27th, 2012, at 09:07:30h +0100, Richard Kettlewell advised:

> You need to read and understand the INVOCATION section of the Bash man
> page.

You can lead a horse to water, but a pencil must be led.

Dan C

unread,
Apr 27, 2012, 8:26:06 AM4/27/12
to
On Fri, 27 Apr 2012 09:07:30 +0100, Richard Kettlewell wrote:

> no.to...@gmail.com writes:
>> OK, /root/.profile does it for THAT user.
>> But where's the global setting? /etc/profile doesn't do it.
>
> You need to read and understand the INVOCATION section of the Bash man
> page.

Do you really think a moron such as the OP is capable of such a thing,
considering the "questions" he asks in here? Really?



--
"Ubuntu" -- an African word, meaning "Slackware is too hard for me".
"Bother!" said Pooh, as he got cattle-prodded in the groin.
Usenet Improvement Project: http://twovoyagers.com/improve-usenet.org/
Thanks, Obama: http://brandybuck.site40.net/pics/politica/thanks.jpg

Dan C

unread,
Apr 27, 2012, 8:26:53 AM4/27/12
to
On Fri, 27 Apr 2012 05:25:37 +0000, no.top.post wrote:

> You get the most effect by optimising the highest-determinant.

<SNIP drivel>

Will you just fuck off and go troll somewhere else, you ignorant fucking
retarded stooge?


--
"Ubuntu" -- an African word, meaning "Slackware is too hard for me".
"Bother!" said Pooh, as he cut his initials in the snow.

Joe Makowiec

unread,
Apr 27, 2012, 9:28:15 AM4/27/12
to
On 27 Apr 2012 in comp.os.linux.misc, Chris Davies wrote:

> I'm also in this situation (having a number of distinct systems). But
> I'm curious to know whether there is any way, other than a straw poll,
> of determining a significant majority view.

I set different colors in the prompt for different machines. That way I
can tell at a glance what machine I'm on.

--
Joe Makowiec
http://makowiec.org/
Email: http://makowiec.org/contact/?Joe

J G Miller

unread,
Apr 27, 2012, 10:12:02 AM4/27/12
to
On Friday, April 27th, 2012, at 13:28:15h +0000, Joe Makowiec wrote:

> I set different colors in the prompt for different machines. That way I
> can tell at a glance what machine I'm on.

Good idea. If you use X Terminals, ever considered of setting the background
color (suitably dark though) a different one for each machine?

Sian Mountbatten

unread,
Apr 27, 2012, 11:40:19 AM4/27/12
to
On 27/04/12 13:26, Dan C wrote:
> On Fri, 27 Apr 2012 05:25:37 +0000, no.top.post wrote:
>
>> You get the most effect by optimising the highest-determinant.
>
> <SNIP drivel>
>
> Will you just fuck off and go troll somewhere else, you ignorant fucking
> retarded stooge?
>
>
Your reply shows juvenile determinant.

--
Sian Mountbatten
ex-Algol 68 specialist

unruh

unread,
Apr 27, 2012, 1:31:35 PM4/27/12
to
On 2012-04-27, Sian Mountbatten <poen...@fastmail.co.uk> wrote:
> On 27/04/12 13:26, Dan C wrote:
>> On Fri, 27 Apr 2012 05:25:37 +0000, no.top.post wrote:
>>
>>> You get the most effect by optimising the highest-determinant.
>>
>> <SNIP drivel>
>>
>> Will you just fuck off and go troll somewhere else, you ignorant fucking
>> retarded stooge?
>>
>>
> Your reply shows juvenile determinant.

Please do not reply to Dan C . If you have not noticed his primary
contribution to almost all discussions is to swear at the people. I
never knew tourette's could also affect the fingers, but I guess he is
an example. Feel sorry for him, but please ignore him.
>

Joe Makowiec

unread,
Apr 27, 2012, 3:50:53 PM4/27/12
to
On 27 Apr 2012 in comp.os.linux.misc, J G Miller wrote:

> Good idea. If you use X Terminals, ever considered of setting the
> background color (suitably dark though) a different one for each
> machine?

I don't, as a rule, use XTerms. Generally (like > 99%), I use PuTTY to
ssh in. There's always a command prompt visible, so I can tell at a
glance what machine I'm on.

Eli the Bearded

unread,
Apr 27, 2012, 4:23:04 PM4/27/12
to
In comp.os.linux.misc, <no.to...@gmail.com> wrote:
> "localhost:/etc#" is VERY lame as a prompt.

I'd agree.

> WTF is the value of the "localhost:" taking up space every time?

I think you mean "WTH machine is localhost anyway? Every computer
is localhost to itself."

> Why don't package-builders optimise/fix this absurdity [for PC
> users, not networked users: the majority; or give a notification]?

Setting a prompt is so damn trivial and often so personal I'd never
expect a package-builder to get it right. I'd take matters into
my own hands and set it myself.

> and this PC currently shows the console-prompt as:
> <user>"@28"<pwd>
> which is great. I'm guessing that "@28" is the console
> number; but the <pwd> is really what you want to know.

Speak for yourself. I never want to see <pwd> in the prompt. I know
what "cd" commands I've issued and I hate prompts that vary a lot in
size. Static things like current tty I prefer to keep in the window
title. That also helps when something screws up, I can use "ps -t"
from a different window to just get the processes from the stuck
tty even if I can't get to a prompt there.

> But where's the global setting?
> /etc/profile doesn't do it.

Figure out what shell you are running and read the man page.
Then you may need to trace through the startup files your
distro has included in /etc/. Mostly I find those set things
I don't care about or worse set things I do care about to be
wrong.

> PS I'm not just looking for a solution to my current little
> problem, but for a global tune-up of GNU/linux.

Setting a prompt is hardly a tune-up.

> And IMO apeing M$ with bouncing cartoons is the wrong way.

I see no cartoons. If you do, there might be something wrong
with your system.

Elijah
------
PS1=": $USER@$HOST; "; PS2=" " # prompts that are cut-n-paste friendly

unruh

unread,
Apr 27, 2012, 7:33:42 PM4/27/12
to
On 2012-04-27, Joe Makowiec <mako...@invalid.invalid> wrote:
> On 27 Apr 2012 in comp.os.linux.misc, J G Miller wrote:
>
>> Good idea. If you use X Terminals, ever considered of setting the
>> background color (suitably dark though) a different one for each
>> machine?
>
> I don't, as a rule, use XTerms. Generally (like > 99%), I use PuTTY to
> ssh in. There's always a command prompt visible, so I can tell at a
> glance what machine I'm on.

Well, no. I do not use Windows at all, so certainly do not use putty.
But if we generalise to ssh, then I agree. I still assume which machine
I am on, and issuing a halt and then discovering it is on some remote
machine (20 min drive away) rather than the local one is one of the
prices I pay for inattentiveness.

>

Sian Mountbatten

unread,
Apr 27, 2012, 9:39:20 PM4/27/12
to
Being relatively new to this group, I did not know what you have just
told me. I have been warned. Thank you.

Marc Haber

unread,
Apr 28, 2012, 7:16:55 AM4/28/12
to
unruh <un...@invalid.ca> wrote:
>On 2012-04-27, Joe Makowiec <mako...@invalid.invalid> wrote:
>> I don't, as a rule, use XTerms. Generally (like > 99%), I use PuTTY to
>> ssh in. There's always a command prompt visible, so I can tell at a
>> glance what machine I'm on.
>
>Well, no. I do not use Windows at all, so certainly do not use putty.

Putty for Linux does exist.

I even used it once, when a switch vendor insisted that putty was the
only ssh client that their device was willing to speak to.

Of course, their device showed the same flaw with putty.

Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Mannheim, Germany | Beginning of Wisdom " | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834

Chick Tower

unread,
Apr 28, 2012, 7:24:06 PM4/28/12
to
On 2012-04-27, unruh <un...@invalid.ca> wrote:
> You really must have very little trouble in your life if the default PS1
> is all you have to complain about.

I know you've been replying to some of the OP's threads over the last
couple of months, so how can you not know that he's always in "trouble"?
The only thing different this time is that it isn't self-inflicted.
--
Chick Tower

For e-mail: aols2 DOT sent DOT towerboy AT xoxy DOT net

no.to...@gmail.com

unread,
Apr 29, 2012, 2:10:12 AM4/29/12
to
In article <slrnjpl34c...@nbleet.hcc.net>, notbob <not...@nothome.com> wrote:

> On 2012-04-27, no.to...@gmail.com <no.to...@gmail.com> wrote:
> > You get the most effect by......
>
> You get the most effect by RTFM!
>
> http://tldp.org/HOWTO/Bash-Prompt-HOWTO/
>
> I put this in my /home/[user]/bash_profile file:
>
> export PS1='\[\033[36m\]\u \w>\[\033[m\]'
>
> The prompt is cyan and indicates user and path
>
Yes COLOR is the most direct, primitive, effective signal.

> I put this in my /root/.bash_profile file:
>
> export PS1='\[\033[1;31m\]\u \w>\[\033[m\]'
>
> The prompt is magenta and indicates root and path.
>
> HTH
> nb
Now I've fetched the: Bash-Prompt-HOWTO/
and am working my way through it. Also
'INVOCATION section of the Bash man'.

The ones that really trip me up are the
`chroot X mc`. When I switch to a VT that I've previously
set so, I usually waste a lot of time before I realise that
it <needs a different language>.

Apparently you can change $PS1 at any time, so,
as the HOWTO seems to show, you can change
the color mapping; but you could not do:
<if the VT has 'p14' in its `pwd` use red,
if P7 use blue>, because you must set $PS1 BEFORE you
switch VT. Or ?

== TIA.


Dario Niedermann

unread,
Apr 30, 2012, 8:48:39 AM4/30/12
to
["Followup-To:" header set to comp.os.linux.misc.]
Joe Makowiec <mako...@invalid.invalid> wrote:

> I set different colors in the prompt for different machines. That way I
> can tell at a glance what machine I'm on.

Same here. Good enough solution if you don't log onto a lot of different
hosts. My tcsh prompt:

set prompt="%{\033[?6c%}%{\033[33;40m%}%{\033[7m%}%c3%#%{\033[0m%} "

Basically, the bottom 3 current pathname components surrounded by ANSI
color codes, followed by the appropriate 'promptchar': '#' for root, '>'
for everybody else.

--
> head -n1 /etc/*-{version,release} && uname -mprs
Slackware 12.1.0
Linux 2.6.24.5-smp i686 AMD Turion(tm) 64 Mobile Technology MK-36
0 new messages