LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-29-2003, 05:56 AM   #1
qanopus
Senior Member
 
Registered: Jul 2002
Location: New York
Distribution: Slackware
Posts: 1,358

Rep: Reputation: 45
setting the PS1 enviroment variable in xterm


Hi there.
This is how the prompt on my xterm looks like : bash-2.05a#
I would like it to look like this : [sohail@linux ~/work] >
I can do this by setting the PS1 enviroment variable, like : export PS1="[\u@\h\w]>"

But how can I make it work automatically when I start an xterm? Making an entery in my ~/.bash_profile or ~/.bashrc won't work. I tried putting an entery in ~/.xinitrc but that doesn't work either. But how then?

Last edited by qanopus; 04-29-2003 at 05:57 AM.
 
Old 04-29-2003, 06:46 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
It's handled from /etc/bashrc but personal customizations like
"case $TERM in xterm*) PS1="${WHATEVER}: ";; esac"
in ~/.bashrc should work as well.
 
Old 04-29-2003, 08:41 AM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Re: setting the PS1 enviroment variable in xterm

Quote:
Originally posted by schatoor
But how can I make it work automatically when I start an xterm? Making an entery in my ~/.bash_profile or ~/.bashrc won't work. I tried putting an entery in ~/.xinitrc but that doesn't work either. But how then?
By default it should work after placing it in your .bashrc file in your home directory. Try something like this:

Code:
#Set the default shell prompt:

PS1='\u@\h:\w\$ '

export PS1
Then just close the xterm and reopen it or logout and relogin again for changes to take affect.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
enviroment variable PATH Moataz Linux - Newbie 2 04-25-2005 08:25 PM
MOZILLA_FIVE_VARIABLE enviroment variable Lechium Slackware 4 08-31-2004 04:19 AM
PS1 variable wogga Red Hat 2 05-26-2004 05:39 PM
Setting PS1 variable for KDE Konsole shell (RH9) robertmarkbram Linux - Software 4 10-14-2003 07:38 PM
Enviroment variable set for all ChimpFace9000 Slackware 5 12-09-2002 09:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:26 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
Open Source Consulting | Domain Registration