Hostname in shell (bash)?

Robert Westendorp rjwsys at uniserve.com
Fri Feb 27 10:32:53 PST 2004


Try:

PS1=`id -un`@`hostname -s`"$ "

I put that into the .bashrc file.

----- Original Message ----- 
From: "Steven N. Fettig" <freebsd at stevenfettig.com>
To: <questions at freebsd.org>
Sent: Friday, February 27, 2004 8:01 AM
Subject: Hostname in shell (bash)?


> Hi all,
>
> I searched the archives and documents on bash, but I can't figure out
> how to put the hostname of the workstation I am on before the $ of the
> shell/command line.  Does anyone know how to add the hostname
> (preferably the first part - i.e. www, db1, etc) to the command line for
> bash 2.x?
>
> Thanks,
> Steve
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
"freebsd-questions-unsubscribe at freebsd.org"



More information about the freebsd-questions mailing list