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: Prompt in Korn shell

Re: Prompt in Korn shell

From: <DBarbour_at_austin.isd.tenet.edu>
Date: Wed, 20 Jun 2001 15:45:21 -0700
Message-ID: <F001.00330F64.20010620151156@fatcity.com>

Alex -

If you're using /usr/bin/ksh as your shell, you read the .profile (.dtprofile on an XDMCP login) in the user's home file. The shell variable is PS1. Here's a snippet from my .profile on an HP-UX box:

#!/usr/bin/ksh

###################################

# Set up the cursor
###################################

export USER=`logname`
export HOST=`hostname`
export PS1='$HOST:$USER $PWD>>'

The prompt looks like this:

qe2l1:dbarbour /home/oracle>>cd /etc
qe2l1:dbarbour /etc>>

You can add variables such as $ORACLE_SID or whatever else you want to see. The tics around the commands logname and hostname are the backwards single quote off the tilde key (I have no idea what they're called - except backwards single quotes), they indicate the shell should execute the command. PWD is a standard shell variable in ksh.

Hope this helps.

David A. Barbour
Oracle DBA, OCP
AISD
512-414-1002

                                                                                       
                               
                    "Hillman, Alex"                                                    
                               
                    <Alex.Hillman_at_usmint.        To:     Multiple recipients of list 
ORACLE-L <ORACLE-L_at_fatcity.com>  
                    treas.gov>                   cc:                                   
                               
                    Sent by:                     Subject:     Prompt in Korn shell     
                               
                    root_at_fatcity.com                                                   
                               
                                                                                       
                               
                                                                                       
                               
                    06/20/2001 03:25 PM                                                
                               
                    Please respond to                                                  
                               
                    ORACLE-L                                                           
                               
                                                                                       
                               
                                                                                       
                               




Anybody knows how to show current working directory and in general shell variable in Korn shell that prompt change when variable changes - for current working directory and ORACLE_SID for example. I know how to do it in
bash but cannot do it right in Korn.

Alex Hillman
--

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

Author: Hillman, Alex
  INET: Alex.Hillman_at_usmint.treas.gov

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).

--

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

Author:
  INET: DBarbour_at_austin.isd.tenet.edu

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 Wed Jun 20 2001 - 17:45:21 CDT

Original text of this message

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