Web Hosting Talk







View Full Version : How does one set up bash startup file?


Carlos123
06-18-2002, 02:57 AM
Hi there,

I was wondering how one would go about setting up a bash start-up file to change the prompt and start up in a certain directory?

I have read that one can create a .bash_profile file in the home directory (in a shared hosting environment) but will bash automatically execute such a file if created there?

You know I gots to hand it to any of you that deal with Unix every day. It's like trying to learn to speak in Chinese ;).

Any insight on this would be appreciated.

Thanks.

Carlos

infinite
06-18-2002, 06:37 AM
yes it should execute that file, unless that has been disabled (unlikely)
try putting this in the .bash_profile (or .profile file).

PS1=$HOSTNAME:$PWD\ \>
cd /home/wherever/

More info can be found from the INVOCATION section of man bash

Hope this helps ;)

Cheers,
Infinite :D

jizaymes
06-18-2002, 05:33 PM
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/sbin:/usr/local/arts/bin:/usr/local/arts/sbin:.:~

umask 022

PS1="\h:\w\\$ "
PAGER="less"
EDITOR="/usr/local/bin/pico"
VISUAL="/usr/local/bin/pico"

if [ "X$SSH2_CLIENT" = "X" ]; then
export TERM=cons25
else
export TERM=vt100
fi

export PATH TERM PS1 PAGER EDITOR VISUAL

alias pico="pico -w"
alias ls="gnuls -F --color=auto"
alias rm="rm -f"
cd




Here is my typical .profile file