[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Unusual termianl prompt?



sai krishna wrote:
Just see in /etc/sysconfig/network
the hostname is there or not??
if not add the hostname there

*/Tim Alberts <talberts msiscales com>/* wrote:

    I'm used to the prompt on the terminal being something like

    [user host ~]$ -or- [user host ~]#

    I have a system that shows the prompt as

    -bash-3.00#

    when logged in as root. However if I log in as a system user, it
    appears normal to me.

    How is this configured and how do I make it 'normal'?

either your .bashrc or .bash_profile or your /etc/bashrc file are non existent or not written properly.

--start .bashrc
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

--end .bashrc

--start .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME
--end .bash_profile

--start /etc/bashrc
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ $UID -gt 99 ] && [ "`id -gn`" = "`id -un`" ]; then
	umask 002
else
	umask 022
fi

# are we an interactive shell?
if [ "$PS1" ]; then
    case $TERM in
	xterm*)
		if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
			PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
		else
PROMPT_COMMAND='echo -ne "\033]0;${USER} ${HOSTNAME%% *}:${PWD/#$HOME/~}\007"'
		fi
		;;
	screen)
		if [ -e /etc/sysconfig/bash-prompt-screen ]; then
			PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
		else
PROMPT_COMMAND='echo -ne "\033_${USER} ${HOSTNAME%% *}:${PWD/#$HOME/~}\033\\"'
		fi
		;;
	*)
[ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
	    ;;
    esac
    # Turn on checkwinsize
    shopt -s checkwinsize
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u \h \W]\\$ "
fi

if ! shopt -q login_shell ; then # We're not a login shell
        for i in /etc/profile.d/*.sh; do
	    if [ -r "$i" ]; then
	        . $i
	    fi
	done
	unset i
fi
# vim:ts=4:sw=4

# alias interactive
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
--end /etc/bashrc


--
My Website: http://messinet.com
My Online Gallery: http://messinet.com/modules.php?name=Web_Links&l_op=visit&lid=3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]