Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Changing Command Line Prompt....
LinuxHatesMe
post Jun 22 2003, 07:29 PM
Post #1


./configure
***

Group: Members
Posts: 65
Joined: 21-June 03
Member No.: 996



I've been noticing alot of peeps have some interesting looking command line prompts. My is the lame default, user@localhost user. What file do I edit to change this and how do I change the name of my localhost to something else?
Go to the top of the page
 
+Quote Post
michaelk
post Jun 22 2003, 09:32 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,796
Joined: 23-January 03
Member No.: 360



http://www-106.ibm.com/developerworks/linu...y/l-tip-prompt/

And then add it to your profile for bash its .bash_profile which is hidden.
Go to the top of the page
 
+Quote Post
Jay-Jay
post Jun 23 2003, 03:51 AM
Post #3


I Eat C Code for Breakfast
****

Group: Members
Posts: 162
Joined: 2-June 03
From: London (UK)
Member No.: 914



Hay, i'm just following up.

If this helps could you let us know as i'm writing a PAQ's page and so I'm asking as many people as I can to write how they sovled their question and how.

Thanks

Jay-Jay


--------------------
I have a new toothbrush that had rubber prongs to massage my gums while I brush. How odd! (Query of life)
Go to the top of the page
 
+Quote Post
LinuxHatesMe
post Jun 23 2003, 12:55 PM
Post #4


./configure
***

Group: Members
Posts: 65
Joined: 21-June 03
Member No.: 996



It sorta did. I mean, the info is there I just can't figure it out. The help page this points too makes me think that it thinks my bashrc file is gonna be plain or simple when there is already a complex code in there that determines the type of window, ie xterm ect. And is in too advanced a form for me to break it down. Perhaps when I boot back into linux I can paste my bashrc here and then the code I'm trying to implement and maybe you guys can tell me why I get what it gives me.
Go to the top of the page
 
+Quote Post
chrisw
post Jun 23 2003, 04:56 PM
Post #5


RMS is my Hero
******

Group: Admin
Posts: 634
Joined: 27-September 02
From: Louisiana
Member No.: 5



try this: its on the guides page

http://www.linuxhelp.ca/guides/bashprompt/


--------------------

Chris W.
Go to the top of the page
 
+Quote Post
LinuxHatesMe
post Jun 23 2003, 05:08 PM
Post #6


./configure
***

Group: Members
Posts: 65
Joined: 21-June 03
Member No.: 996



First off I'd like to say that page is nice, but the problem I am having now is that I don't know where within all this code from my bashrc I should put my new prompt code... take a look at you'll see what I mean.. I am supposed to add an export code within all this junk. Where tho?


# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
umask 002
else
umask 022
fi

# are we an interactive shell?
if [ "$PS1" ]; then
case $TERM in
xterm*)
PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD}07"'
;;
*)
;;
esac
[ "$PS1" = "\s-\v\$ " ] && PS1="[u@h W]\$ "

if [ -z "$loginsh" ]; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -x $i ]; then
. $i
fi
done
fi
fi

unset loginsh
Go to the top of the page
 
+Quote Post
michaelk
post Jun 24 2003, 02:10 PM
Post #7


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,796
Joined: 23-January 03
Member No.: 360



Actually it says add it to your profile not bashrc file.

And I would add it to your /home/user/.bash_profile not the global files in /etc
Go to the top of the page
 
+Quote Post
LinuxHatesMe
post Jun 24 2003, 06:23 PM
Post #8


./configure
***

Group: Members
Posts: 65
Joined: 21-June 03
Member No.: 996



Well I'm not sure what I did wrong, it said the changes would take place immediately. But I saw no changes. I had copied back over my backup file. And here is what it contains

# .bash_profile



# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME


Where in that would I place my prompt code? I tried placing it at the VERY end of the file and just after the first line. Neither worked. sad.gif
Go to the top of the page
 
+Quote Post
chrisw
post Jun 25 2003, 12:14 PM
Post #9


RMS is my Hero
******

Group: Admin
Posts: 634
Joined: 27-September 02
From: Louisiana
Member No.: 5



did you logout and log back in for the changes to take place


--------------------

Chris W.
Go to the top of the page
 
+Quote Post
LinuxHatesMe
post Jun 25 2003, 04:09 PM
Post #10


./configure
***

Group: Members
Posts: 65
Joined: 21-June 03
Member No.: 996



Didn't know I was supposed to. smile.gif I decided to rid myself of mandrake and installed rh 9 this morning, gonna redo this, test it, and give ya guys some feedback in about an hour or so.
Go to the top of the page
 
+Quote Post
Hemant
post Jun 26 2003, 02:36 AM
Post #11


RMS is my Hero
******

Group: Support Specialist
Posts: 782
Joined: 6-October 02
From: Trichy,INDIA
Member No.: 29



simple....there should be a file called .bashrc in ur home directory....simple edit that file and at the end add following lines...

PS1="MITOCHONDRI<\w>"
export PS1

this will work certainly....

and adding these lines to the .bash_profile will be effective only when...
1.u r logged in to text mode
2.or when u use xwindow enter command . .bash_profile manualy...


--------------------
Hemant Kumar
user posted image
hemant@linuxhelp.net
Go to the top of the page
 
+Quote Post
Hemant
post Jun 27 2003, 09:33 AM
Post #12


RMS is my Hero
******

Group: Support Specialist
Posts: 782
Joined: 6-October 02
From: Trichy,INDIA
Member No.: 29



hey whether it worked or not..


--------------------
Hemant Kumar
user posted image
hemant@linuxhelp.net
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 17th October 2017 - 11:07 PM