Reply
Thread Tools
Posts: 838 | Thanked: 292 times | Joined on Apr 2010
#1
I installed bash and want to keep the old prompt I had with busy box for the user "user". I already destroyed and had to completely reflash in a previous attempt to get back my old prompt. fyi here is was the PS1 on busy box..."\w \$".

once in as user in bash I can type that and if changes to the old nicer busy box prompt but of course it gets lost. I tried putting it in .bashrc and exporting but that did not make any difference (unless I then manually typed source .bashrc). I also tried putting "source ~/.bashrc" in /etc/bash.bashrc, but that did not help either...

so in summary...using bash now for both user and root. happy with root prompt (kept the old prompt) but hate user prompt and want to get it back to my old prompt...without having to do another complete kernel and emmc reflash...

thanks...

Last edited by extendedping; 2010-11-01 at 20:28.
 
jedi's Avatar
Posts: 1,411 | Thanked: 1,330 times | Joined on Jan 2010 @ Tatooine
#2
http://talk.maemo.org/showpost.php?p=854076&postcount=7

Originally Posted by jedi View Post
Is it the prompt that's the problem? If I remember correctly the default one is quite 'complex', especially on the N900 screen.

I edited /etc/profile.d/prompt and just added:
Code:
export PS1='N900:\W \$ '
at the end of the file, completely over-riding the code above it.
 
Posts: 838 | Thanked: 292 times | Joined on Apr 2010
#3
as user "user" with shell now as /bin/bash I created a .profile file in the home directory.

In that I put ...

PS1="\w \$ "
export PS1

Please note the space between $ and " so the cursor is not flush with the prompt.

Bingo I have my old prompt back but I am using bash as my shell.
 
Posts: 303 | Thanked: 175 times | Joined on Oct 2009 @ London UK
#4
I add this to my .bashrc:

Code:
export PS1="`awk '($1=="name") { sub(/^name /,"",$0) ; print; f=1} END{if (!f) exit 1}' /var/lib/bluetooth/[0-9A-Fa-f]*/config || echo "\\h"`:\w \\$ "
Sets the prompt to contain the bluetooth name of the phone, if it has one, otherwise it sets it to be the hostname (which is not unique in maemo)


myphone:/etc $
 

The Following User Says Thank You to cpitchford For This Useful Post:
Posts: 838 | Thanked: 292 times | Joined on Apr 2010
#5
Originally Posted by cpitchford View Post
I add this to my .bashrc:

Code:
export PS1="`awk '($1=="name") { sub(/^name /,"",$0) ; print; f=1} END{if (!f) exit 1}' /var/lib/bluetooth/[0-9A-Fa-f]*/config || echo "\\h"`:\w \\$ "
Sets the prompt to contain the bluetooth name of the phone, if it has one, otherwise it sets it to be the hostname (which is not unique in maemo)


myphone:/etc $
that is scary. btw are you using bash? I wonder why my .bashrc command did not work.
 
Posts: 303 | Thanked: 175 times | Joined on Oct 2009 @ London UK
#6
It was late..so I missed this important step

Add this to the end of /home/user/.profile:
Code:
if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi
I'm not using bash, as much as I love it.. On all systems, I try to use the shell provided, saves me doing something that works on mine, but not other N900s..
 
Posts: 838 | Thanked: 292 times | Joined on Apr 2010
#7
ah so any way you do need to create a .profile (there was none there on my phone)....
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 08:12.