PDA

View Full Version : Change bash prompt...


TivoHolic
05-27-2005, 09:23 PM
Hello,

Can anyone tell me how to change the bash (telnet) prompt to something other then "bash-2.02#" I would like "Tivo1 /path" I have two tivos and sometimes it's hard to tell which one I am playing with.

I've not found a way to do this!

Thanks in advance!

Thinkdiff
05-27-2005, 09:47 PM
set up a .profile in /etc or / and put the lines:

PS1="\u@\h:\w> "
export PS1



for example..

that particular one results in:

root@(none):/var/tmp>

now if you set your hostname:

hostname tivo1

you get:

root@tivo1:/var/tmp>

edit to taste.

classicsat
05-28-2005, 09:53 AM
AFAIK, .profile is for telnet, you want to copy whatever you create there needs to be copied to a file called .bashrc , for serial bash.

hayreass
05-28-2005, 12:01 PM
AFAIK, .profile is for telnet, you want to copy whatever you create there needs to be copied to a file called .bashrc , for serial bash.Nope, it works great on serial bash as well providing you use -login in your command to turn on bash.

Here's the line I use to turn on bash./bin/bash </dev/ttyS2&>/dev/ttyS2 -login&you must have a space before the -login, or it won't work.
I'm pretty sure you need to add -login to the line that starts telnet as well. Just do the same thing if necessary, add a space and -login just before the ampersand.

TivoHolic
05-30-2005, 02:48 PM
This worked great.

However I created the .profile and couldn't get it to work.

I noticed that I had a simular line in my rc.system.author file that was commented out.

I uncommented it and made a couple changes to what was there and viola it gave me exactly what I was looking for!

No when I access each Tivo I can tell them easily apart!

Thank you for the guidence!