Mladen, Your magnificent intuition and superior powers of reasoning have finally failed you.
I've never touched VMS. ;) Jared "Gogala, Mladen" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 08/26/2002 01:28 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> cc: Subject: RE: Unix question: how to display SID and path in prompt Jared, the "alias cd='go'" line immediately betrays you as a former VMS person. Next thing you know and your aliases will be like "set_def"" > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Monday, August 26, 2002 3:08 PM > To: Multiple recipients of list ORACLE-L > Subject: RE: Unix question: how to display SID and path in prompt > > > > Also be aware that when using backticks in your PS1 > variable, you are > > influencing $? as a result. > > I don't find that to be true with pdksh - PD KSH v5.2.14 99/07/13.2 > > function go { > \cd $1 > typeset -Z2 _h; typeset -Z2 _m # 2 > digits, zero padded > _hh="(SECONDS/3600)%24" _mm="(SECONDS/60)%60" # hours, minutes > _time='${_x[(_m=_mm)==(_h=_hh)]}$_h:$_m' > typeset bold=$(tput bold) > typeset shy=$(tput rmso) > PS1="[ `pwd` ]" > PS1=$PS1`echo > "\n\n${bold}$_time-${UMACHINE}:${ORACLE_SID}${shy}:${LOGNAME}- > $TTY > "` > # need to be able to turn xtitle off when using 'go' > if [ "$TERM" = "xterm2" -o "$TERM" = "xterm" ] ;then > # don't do xtitle if NO_CD_TITLE is set or in SCREEN > #[ "$NO_CD_TITLE" -o "$WINDOW" -ge 1 ] || xtitle > ${MACHINE}:${PWD} > : > fi > } > > alias cd='go ' > > -------------------- > 10:2-rsysdevdb:dv01:jkstill-3 > rm this_file_does_not_exist > rm: cannot remove `this_file_does_not_exist': No such file or > directory > [ /home/jkstill/tmp ] > > 10:2-rsysdevdb:dv01:jkstill-3 > echo $? > 1 > [ /home/jkstill/tmp ] > > 10:2-rsysdevdb:dv01:jkstill-3 > echo $? > 0 > [ /home/jkstill/tmp ] > > 10:2-rsysdevdb:dv01:jkstill-3 > > > Jared > > > > > > "Curiel, David" <[EMAIL PROTECTED]> > Sent by: [EMAIL PROTECTED] > 08/26/2002 08:23 AM > Please respond to ORACLE-L > > > To: Multiple recipients of list ORACLE-L > <[EMAIL PROTECTED]> > cc: > Subject: RE: Unix question: how to display SID > and path in prompt > > > > > Also be aware that when using backticks in your PS1 variable, you are > influencing $? as a result. > > What happens, is that when you run a command (i.e. "rm > <some_file_that_doesnt_exist>") and then say "echo $?", you > are getting > the > return code ($?) of your PS1 execution (which is likely to > always be 0) - > NOT the $? of the "rm" command. > > David Curiel > > > > > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.com > -- > Author: > INET: [EMAIL PROTECTED] > > 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: [EMAIL PROTECTED] (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: Gogala, Mladen INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).