LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2004, 03:41 AM   #1
newinlinux
Member
 
Registered: Dec 2003
Location: Next to Equator
Distribution: GNU/Linux 2.6.14
Posts: 382

Rep: Reputation: 30
Newbie questions:Bash Prompts


Hi All,
I have my bash prompts set to PS1="[\t][\u@\h:\w]\$ in my /home/user directory with a .bashrc, it works for the user. But I just don't know how to do it for the root. I made one .bashrc file at /root and at /home, both wont work. Any clue? Thanks!
 
Old 03-10-2004, 03:57 AM   #2
iluvatar
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403

Rep: Reputation: 30
don't know... I put this in my /root/.bashrc to test:

#!/bin/bash
PS1="[\t][\u@\h:\w]\$
export PS1

works fine, nice bash prompt btw
 
Old 03-10-2004, 04:01 AM   #3
newinlinux
Member
 
Registered: Dec 2003
Location: Next to Equator
Distribution: GNU/Linux 2.6.14
Posts: 382

Original Poster
Rep: Reputation: 30
hmm, i didn't put the export PS1 under PS1="[\t][\u@\h:\w]\$. I will try it tonight. My user is showing the prompt nicely, only the root is not, strange. Thanks for your reply.
 
Old 03-10-2004, 04:02 AM   #4
iluvatar
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403

Rep: Reputation: 30
seems you don't actually have to export it it works for me anyway...
 
Old 03-10-2004, 04:04 AM   #5
newinlinux
Member
 
Registered: Dec 2003
Location: Next to Equator
Distribution: GNU/Linux 2.6.14
Posts: 382

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by iluvatar
seems you don't actually have to export it it works for me anyway...
you mean both user and root work?
 
Old 03-10-2004, 04:35 AM   #6
iluvatar
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403

Rep: Reputation: 30
yes, both work fine with me... maybe there's something going on in your /etc/zprofile file, that's a system-wide profile configuration, contains some bash prompt stuff also (they are exported there too)
can't u change that one?

Last edited by iluvatar; 03-10-2004 at 04:38 AM.
 
Old 03-10-2004, 04:59 AM   #7
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
What happens when you source your ~/.bashrc? Tye source ~/.bashrc and see if your prompt changes to the one you specified. If so your problem is that it's just not executed when you log in.

Make sure your .bashrc is sourced (executed) from your ~/.bash_profile. In the latter you should have lines approximately like these:
Code:
if [ -e ~/.bashrc ]
then
    source ~/.bashrc
fi
This will make the commands in your .bashrc always are executed.


Håkan

Last edited by hw-tph; 03-10-2004 at 05:01 AM.
 
Old 03-10-2004, 08:47 AM   #8
newinlinux
Member
 
Registered: Dec 2003
Location: Next to Equator
Distribution: GNU/Linux 2.6.14
Posts: 382

Original Poster
Rep: Reputation: 30
hakan, thanks, the source works, but my .bash_profile doesn't help. I created a .bash_profile at my home directory but the prompt is still showing bash-2.05b# rather than my preferred:

8.15PM root@darkstar:/#

Any other ideas ?
 
Old 03-10-2004, 07:15 PM   #10
newinlinux
Member
 
Registered: Dec 2003
Location: Next to Equator
Distribution: GNU/Linux 2.6.14
Posts: 382

Original Poster
Rep: Reputation: 30
thanks. I will experiment more.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
i need help with some newbie bash commands Alexander.s Programming 14 12-24-2004 03:33 PM
Bash Prompts with xterm-style terminals somnium Linux - General 1 09-11-2003 09:43 AM
Questions about bash colors.... jcornel7 Linux - Newbie 7 02-05-2003 03:13 PM
Newbie Bash Problem that_girl Programming 10 08-08-2002 09:58 PM
newbie to bash scripts kballing Programming 1 07-21-2002 12:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration