Title: Unix question: how to display SID and path in prompt
Put $PWD in there somewhere. I use ${PWD#${PWD%%*([!/])/*([!/])}} to display the last two directory levels, so my prompt never gets TOO long.
 
The substring extraction of $PWD is ksh specific. You could do it other ways, but this way it uses ksh builtins, so it is _fast_
 
As an example, when I am in my $ORACLE_HOME, my prompt ends up looking something like:
 
product/8.1.7 [09:54:42 AM] 181$
 
where 181 is the current command history number.
----- Original Message -----
Sent: Monday, August 26, 2002 9:48 AM
Subject: Unix question: how to display SID and path in prompt

Hi!

In my .profile of the oracle user (we're mostly using ksh here), I have set up the prompt that it gives me the host name and database SID.

# always displays host name and Oracle SID as prompt
PS1="`hostname`;`echo $ORACLE_SID`$ "

How can I extend this prompt to also include the current directory that I'm in?

e.g. prod1;PCLDB1; u010/app/oracle/admin/PCLDB1

Thanks,
Helmut

Reply via email to