Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Unix question: how to display SID and path in prompt

Re: Unix question: how to display SID and path in prompt

From: Philip Douglass <philipd_at_sirs.com>
Date: Mon, 26 Aug 2002 07:03:19 -0800
Message-ID: <F001.004BF8DB.20020826070319@fatcity.com>


Unix question: how to display SID and path in promptPut $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.

  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

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Philip Douglass
  INET: philipd_at_sirs.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Mon Aug 26 2002 - 10:03:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US