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!

changing prompt line display 2

Status
Not open for further replies.

gatetec

MIS
Mar 22, 2007
420
US
With root account, it says,

mil:/ >

1) there is an extra space on mil:/ >. How do I remove the space so that it shows mil:/> w/o space?


2) if I su - oracle, it says something else than mil:/>.

What I want is

oracle@mil:/>

thx much
 
I would start by comparing your .profile to oracle's .profile. Then compare those with /etc/profile
 
Look in /etc/profile or in $HOME/.profile

There will be something like

Code:
PS1="$(hostname):"'$PWD > '

change it to

Code:
PS1="$(hostname):"'$PWD> '

in ${HOME}/.profile for oracle user, there will need to be an additional ${LOGNAME}@ in front

Code:
PS1="${LOGNAME}@$(hostname):"'$PWD> '

Note, this syntax is for korn shell only. And this is from memory - not at a machine at the moment.


HTH,

p5wizard
 
I have:

export PS1=${LOGIN}:$(uname -n):'$PWD>'

but still there is an extra space. I logged out and back in, but the extra sapce is still there.

thx
 
Check to see if the PS1 setting from /etc/profile is overridden in some other profile or setup script.

using your PS1 setting I get:

Code:
# PS1=${LOGIN}:$(uname -n):'$PWD>'
root:XXX:/>_

no spaces whatsoever...

Try this also and see what you get (post back here with result):

Code:
root:XXX:/>echo "PS1 is [$PS1]"
PS1 is [root:XXX:$PWD>]
root:XXX:/>_


HTH,

p5wizard
 
I am getting:

mil:/ > echo "PS1 is [$PS1]"
PS1 is [$HOST:$PWD > ]

thx much
 
Well then, there you have it. Some script other than /etc/profile is putting in the spaces before and after the GreaterThan character...


HTH,

p5wizard
 
I have tried these three:

export PS1="$LOGNAME@`uname -n`:\$PWD>"
export PS1=${LOGIN}:$(uname -n):'$PWD>'
export PS1="$USER@`uname -n`:\$PWD>"

But, there is no space aorung the ">" symbol.
It could be something esle.......??
 
Is the user name showing up, but the space is still there, or is it still just plain "mil:/ > "?

Check to see if "echo $ENV" gives you a filename. If it does, check that file for redefining of PS1. You also might want to check /etc/environment, although I'm pretty sure ~/.profile runs AFTER that.

- Rod


IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

A Simple Code for Posting on the Web
 
YUP!!!

.profile had:

export PS1='$HOST:$PWD > '

After the correction to
export PS1='$HOST:$PWD> '

The extra space is gone.

thx much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top