Click to See Complete Forum and Search --> : user@localhost - another question :)


Mulchman MM
09-20-2001, 01:37 PM
I'd like to change my command line from "user@localhost" to "user@X" where X is my actual hostmask, but have it do so w/o me having to edit /etc/rc.d/rc.inet1 and tell is specifically that my hostmask is "orf-sdsl-64-XX" or anything like that EACH TIME I start up the machine.

I DONT have a specified IP so it changes from time to time.
ie. orf-sdsl-64-76 or orf-sdsl-64-22

I'm assuming I have to change one of my startup scripts, but that's what I'm not sure of - and I'm not sure of what to change / modify in the script.

I'm running Slack 8, Kernel 2.2.19.

[ 20 September 2001: Message edited by: Mulchman MM ]

[ 20 September 2001: Message edited by: Mulchman MM ]

wreckd
09-20-2001, 03:29 PM
why would you edit an rc script? why not just edit your personal bashrc so that you have something like
export PS1="[\u@`/path/to/some_script`]\$"
and write the script that can figure out the part of your hostname you want? i'm not sure, but i think that this would only be updated when you start a new shell...but i could be wrong.

mind if i ask what you want this for?

ph34r
09-20-2001, 03:45 PM
Or get a dyndns.org account and keep a constant hostname...

Mulchman MM
09-20-2001, 05:30 PM
The reason I want this is because when I used Mandrake about a year ago, at the command line it had "user@hostmask" where hostmask was either "orf-sdsl-64-xx" or it was my IP. Come to think of it I can't remember which it was (the hostmask or the IP), but I liked that better than just "user@localhost". To me, that's cheezy.

Mulchman MM
09-20-2001, 09:04 PM
Actually, all I really need to know how to do is get my address / hostmask / whatever it's called (orf-sdsl-64-xx) in the PS1. \h just brings in "localhost". How can I, I guess, "resolve" my hostmask / address in my .bash_profile, or either export my hostmask from another script and then just be able to use the variable in my PS1= thingie?