Jump to content

changing localhost name to something else?


Recommended Posts

the same file unless fedora does some magic, in ~/.bashrc

ie, put these lines in your ~/.bashrc:

release=/etc/mandrake-release
if [ -f "$release" ]; then
myrelease=$(sed -n 's/.*\([0-9]\{2\}.[0-9]\{1\}\).*/mymdk\1/p' "$release")
fi
PS1="[\u@${myrelease}]\$ "
export PS1
unset myrelease release

so you'll have what you want even if you upgrade mandrake:

[aru@mymdk10.1]$

 

also if you want the working directory propmted too, then use this PS1

PS1="[\u@${myrelease} \w]\$ "

 

hth

Link to comment
Share on other sites

mattie, despite of what the title of the thread says, imdeemvp doesn't want to change the host name, he just want to change the comand line prompt. But yes, in case you want to change the localhost name one of the ways is that one you said.

Link to comment
Share on other sites

Of course changing the host name should also change the bash prompt.

 

Just be carefull where you change the host name, I remember on a fedora box simply changing it via the hostname command and this causing loads of problems as it was also looked up in another (probably redhat specific) location.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...