You are not logged in.

#1 2008-03-12 13:03:38

Samus_
Member
Registered: 2007-05-25
Posts: 13

displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

hello, I have this same problem: http://bbs.archlinux.org/viewtopic.php?id=39192 but the "solution" posted there does not help me at all, I wish I could reuse the old thread but the 'SOLVED' keyword in the title may be confusing so I'm starting a new one.

the problem is that the prompt of my terminals (konsole, yakuake, xterm) is PS1='\s-\v\$ ' in all users; this started to happen after the last upgrade when the profile mechanism was changed somehow, I have no PS1 in my .bashrc and the PS1 in profile.bash is PS1='[\u@\h:\w]\n\$ '.
an interesting thing to know is that the virtual consoles (the ones accessed with Ctrl+Alt+F[1-6]) have the right prompt, and sourcing /etc/profile also fixes the problem on the others so I'm guessing that some other configuration file (possibly KDE or X related) is overwriting my prompt but I can't find it! fgrep -R 'PS1' /etc/profile* only shows the one I set not the wrong one.
/etc/profile and /etc/profile.bash are being loaded since the other declarations are present as well when running `set` only PS1 has changed it's value.
any help is appreciated.

Offline

#2 2008-03-12 13:09:50

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

local bash config overrides everything else. if you don't have PS1 in your .bashrc, what are you waiting for?


I need real, proper pen and paper for this.

Offline

#3 2008-03-12 13:30:20

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

See thread for setting up ~/.bashrc and ~/.bash_profile correctly.

Offline

#4 2008-03-13 08:14:20

Samus_
Member
Registered: 2007-05-25
Posts: 13

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

schivmeister wrote:

local bash config overrides everything else. if you don't have PS1 in your .bashrc, what are you waiting for?

.bashrc is for customizing some settings for a particular user, I want to set the initial prompt for all users and left some particular customization for the .bashrc
I know I could set each .bashrc since I have only two users plus root but that's not the right way to do it

brebs wrote:

See thread for setting up ~/.bashrc and ~/.bash_profile correctly.

the problem is not local and .bash_profile is set correctly also (besides the fact that I don't set the PS1 in .bashrc)


thanks for the replies

Offline

#5 2008-03-13 09:19:15

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

I would add a "default" PS1 to /etc/skel/.bashrc, so every new user you create has this default PS1 in their ~/.bashrc.
Still leaves a bit of a gap for those users you already created though...
Maybe this works:

# for file in $( find /home -name ".bashrc" ) ; do [[ "x$( grep PS1 ${file} ) == "x" ]] && echo 'export PS1=<prompt>' >> ${file} ; done

Mind you, this is just off the the off my head, without a possibily to test, so use at your own risk wink

Last edited by klixon (2008-03-13 09:27:47)


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#6 2008-03-14 15:12:04

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

Why not unset all PS variables?


I need real, proper pen and paper for this.

Offline

#7 2008-03-14 15:40:07

Samus_
Member
Registered: 2007-05-25
Posts: 13

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

still searching, first of all some tests I've made with the help of the guys at #bash

[11:33] <`Samus_> guys is it possible that starting X somehow erases my prompt?
[11:33] <`Samus_> I know that's is not purely bash and maybe OS-specific sorry
[11:33] <`Samus_> but it's geting me nuts
[11:33] <{xmb}> cant find it
[11:34] * Vadi (n=vadi@H108.C192.cci.switchworks.net) has joined #bash
[11:34] * Vadi (n=vadi@H108.C192.cci.switchworks.net) has left #bash
[11:34] <pgas> `Samus_: where do you define your prompt?
[11:34] * albech (n=thomas@535AB203.flatrate.dk) has joined #bash
[11:35] * Agiofws has quit (Remote closed the connection)
[11:35] <`Samus_> is bieng defined in /etc/profile (/etc/profile.bash really but it-s sourced from there) there-s no PS1 in .bashrc and the rest of the variables are set
[11:35] <`Samus_> the most weird part is that in the virtual consoles (Ctrl+Alt+[1-6]) is ok
[11:36] <{xmb}> smells likke a code fault
[11:36] <`Samus_> but everything under X not
[11:36] <pgas> what if you do bash --login in xterm?
[11:36] * Oper_ (n=op_scrip@nat1.vil.com.ua) has joined #bash
[11:36] <`Samus_> let's see
[11:37] <`Samus_> bash --login shows it ok
[11:37] <`Samus_> in fact resourcing /etc/profile fixes it too
[11:38] <{xmb}> code fault something where
[11:38] <pgas> ok, so one of the script starting X sets PS!
[11:38] <pgas> you are on debian? have you checked /etc/bash.bashrc ?
[11:38] <`Samus_> that's what I think but I can't find it
[11:39] <`Samus_> no I'm on archlinux
[11:39] <pgas> what if you type just "bash" in a terminal?
[11:39] <`Samus_> and it might be some mistake because it started to happen after the last upgrade
[11:39] * floyd_n_milan (n=mrugesh@203.129.234.146) has joined #bash
[11:39] * hark (n=strider@hark.slew.org) has joined #bash
[11:40] <`Samus_> 'bash' shows the wrong prompt, 'bash --login' the right one
[11:40] <pgas> in a terminal with the correct PS1 that is
[11:40] * osfulgore (n=farbou@webmailer.c2is.fr) has joined #bash
[11:40] <`Samus_> oh, in a terminal with the right prompt it stays ok
[11:40] * `Samus_ fells kinda lost...
[11:41] <pgas> ok, so the problem seems to be in one of the script used to start X
[11:42] * prince_jammys has quit ("Konversation terminated!")
[11:42] * Oper_ has quit ("Íå çíàåòå Äàíèëà Áåðåíöåâà? Îí ñêîðî âñòðåòèòñÿ âàì! Íå ñëûøàëè òàêîãî àâòîðà? Äîñòàíüòå ïðÿìî çàâòðà!!!")
[11:42] * Oper_ (n=op_scrip@nat1.vil.com.ua) has joined #bash
[11:42] <`Samus_> grepping 'PS1' in /etc/X11 didn't showed anything
[11:42] <`Samus_> some clue of what should I look for (or where)?
[11:43] <pgas> startx? ask #archlinux?
[11:43] <`Samus_> going...

I've also tried different WMs (KDE, xmonad) and they have this same problem but then, "fgrep 'PS1' /usr/bin/startx" and "fgrep -R 'PS1' /etc/X11/" showed nothing!! now what?


truly wtf...

Offline

#8 2008-03-14 17:24:18

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

http://bbs.archlinux.org/viewtopic.php?id=35970 does this help sounds like the same problem.

Offline

#9 2008-03-16 00:22:55

Samus_
Member
Registered: 2007-05-25
Posts: 13

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

FeatherMonkey wrote:

http://bbs.archlinux.org/viewtopic.php?id=35970 does this help sounds like the same problem.

no thank you, in this case all files (/etc/profile, /etc/profile.bash, ~/.bash_profile, ~/.bashrc) are being read but when X starts something sets my PS1 to "\s-\v\$ "

Offline

#10 2008-03-16 11:35:44

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

this may help

the way i realized this is that startx is a bash script. what this means is, startx will wipe out your prompt. when you set PS1 in .profile (or .bash_profile), login at console, fire up X via startx, your PS1 gets nuked in the process leaving you with the default prompt.


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#11 2008-03-17 19:48:04

Samus_
Member
Registered: 2007-05-25
Posts: 13

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

klixon wrote:

this may help

the way i realized this is that startx is a bash script. what this means is, startx will wipe out your prompt. when you set PS1 in .profile (or .bash_profile), login at console, fire up X via startx, your PS1 gets nuked in the process leaving you with the default prompt.

oh crap...

Offline

#12 2008-03-17 23:30:35

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

Turtle... You sure you posted in the right thread?

Samus_...Maybe a quick fix for your problem would be to "source /etc/profile" from .xinitrc?

Last edited by klixon (2008-03-17 23:30:51)


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#13 2008-03-18 00:05:04

turtle
Member
From: Czestochowa, Poland
Registered: 2006-02-05
Posts: 20
Website

Re: displaying bash-3.2$ in terminal [NOT-SOLVED after last upgrade]

klixon wrote:

Turtle... You sure you posted in the right thread?

I'm sorry. I don't know how it has happend.

Offline

Board footer

Powered by FluxBB