Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change bash profile

Status
Not open for further replies.

hok1man

Technical User
Feb 16, 2008
102
Hi guys,

Just quick question,

If I type bash...
I'm expecting in the prompt command:
[username@SuffixServerName ~]

but now it comes up
bash-2.03$

How would I get the prompt as I am expecting.
which profile should I change.

Thanks guys,
 
Bash looks first for a file in your home directory called .bash_profile, then if that's not present, it looks for .profile. You can customise your prompt by setting the value of the PS1 variable in one of those files.

Note that they are hidden files (due to the "." prefix) so you will need to use ls -a to check whether they exist.

Annihilannic.
 
Thanks Anni,

few more question:
Are these variable like $HOSTNAME and $WHOAMI system variables, or it comes from source somewhere?
I tried to look for them but I couldn't find it.

Cheers man,

 
They may be set in the global profiles that are run for all users. Try looking in /etc/bashrc and /etc/profile.

Annihilannic.
 
I have search in both files and they don't exist and don't even source from any files..

any idea where else to check?

Thanks man
 
What operating system and version are you running? It's possible that some of these variables are set by the sshd and/or /usr/bin/login processes which spawned your shell.

Annihilannic.
 
my system is Solaris 8,
I couldn't run sshd but I can run /usr/bin/login
how to get out from it once you running?
they keep asking your login...

Cheers,
 
You aren't supposed to run them yourself (I didn't suggest that you should).

Unfortunately I don't have a Solaris 8 system to hand to check where/how those variables are set by default, someone else may be able to help.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top