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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

prompt change on command line

Status
Not open for further replies.

gatetec

MIS
Mar 22, 2007
420
US
In .profile, I have:

export HOST=`hostname`
export PS1='$HOST:$PWD>> '
export PATH=$PATH:/usr/local/bin:
export MANPATH=/usr/man:/usr/local/man

On su - oracle, I get this.

milt:/>> su - oracle
ORACLE_HOME=/u01/oracle/product/9.2.0.5
$ pwd
/home/oracle


but, what I want is:

milt:/> su - oracle
ORACLE_HOME=/u01/oracle/product/9.2.0.5
oracle@milt:/home/oracle>

I think I have everything in .profile.

What am I missing here?

thx much
 
May be that the variable $PWD is not set at runtime ....
You can fill it before or using system commands maybe like :
export PS1='$HOST:`pwd`>>'

 
it is using /usr/bin/ksh

Where do I need to put export PS1='$HOST:`pwd`>>' ?
under oracle .profile ?
 
Yes, I took the line from your posting so I guess it is the .profile
The Original Line is

export PS1='$HOST:$PWD>> '

change it to

export PS1='$HOST:`pwd`>>'

 
uups - sorry I do not have an AIX to test. Other way is to fill a Variable calles $PWD before with the system command

export $PWD=`pwd`
export PS1='$HOST:$PWD>> '


does this fix it ?

 
Oops. Should read:
typeset -x \
PS1=$USER@$(hostname -s):'$PWD>'
 
it is odd.

I still get:

milt:/>> su - oracle
ORACLE_HOME=/u01/oracle/product/9.2.0.5
$ pwd
/home/oracle
 
As oracle, what happens when you type in:
typeset -x \
PS1=$USER@$(hostname -s):'$PWD>'

Also, is there anything unusual in your .profile? Are the permission set so you can read it?
 
I am getting this.

$ typeset -x \
> PS1=$USER@$(hostname -s):'$PWD>'
oracle@mil:/home/oracle>

so, what needs to be chekced?

thx
 
The oracle user needs to be able to read the .profile.

Check the rights: ls -la ~oracle/.profile

ls -la ~oracle/.profile
-rw------- 1 oracle staff 929 Dec 11 11:51 /home/oracle/.profile
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top