Unix Q: ksh scripting

2002-07-23 Thread Ross Collado
Hi all, Can any of our Unix gurus here transform my script below to work properly? The intention is to print the last line of the sqlplus output. With set -x, it appears anything after the last EOF is ignored. Why? Thanks. Ross #!/bin/ksh #set -x sqlplus /

RE: Unix Q: ksh scripting

2002-07-24 Thread chris . w . johnson
Oops, missed a quotation mark in earlier posting. Should have read: sqlplus -s / << EOF | grep -v ^$ | sed -n '$p' select sysdate from dual; exit EOF Regards Chris -Original Message- Sent: 24 July 2002 09:15 To: '[EMAIL PROTECTED]' Ross, You are hitting a couple of problems here:

RE: Unix Q: ksh scripting

2002-07-24 Thread chris . w . johnson
Ross, Not sure if original mail got through (looked garbled on Fatcity website) so here goes again You are hitting a couple of problems here: 1 - the 'tail' command needs to be on your first line (sqlplus /

RE: Unix Q: ksh scripting

2002-07-24 Thread chris . w . johnson
Ross, You are hitting a couple of problems here: 1 - the 'tail' command needs to be on your first line (sqlplus /

Re: Unix Q: ksh scripting

2002-07-24 Thread Connor McDonald
print " conn / as sysdba select some_stuff.. exit" | sqlplus /nolog | tail -1 hth connor --- Ross Collado <[EMAIL PROTECTED]> wrote: > Hi all, > Can any of our Unix gurus here transform my script > below to work properly? > The intention is to print the last line of the > sqlplus output. > Wi

RE: Unix Q: ksh scripting

2002-07-24 Thread Thomas, Kevin
I get the following output: spauser > sh kev.sh + sh kev.sh SQL*Plus: Release 3.3.2.0.0 - Production on Wed Jul 24 09:22:05 2002 Copyright (c) Oracle Corporation 1979, 1994. All rights reserved. Connected to: Oracle7 Server Release 7.3.2.3.0 - Production Release With the distributed and para

RE: Unix Q: ksh scripting

2002-07-24 Thread Thomas, Kevin
Hmm, this still doesn't seem to work. -Original Message- Sent: 24 July 2002 10:38 To: Multiple recipients of list ORACLE-L Oops, missed a quotation mark in earlier posting. Should have read: sqlplus -s / << EOF | grep -v ^$ | sed -n '$p' select sysdate from dual; exit EOF Regards C

RE: Unix Q: ksh scripting

2002-07-24 Thread Richard Huntley
Title: RE: Unix Q: ksh scripting With the addition of the extra quote...this worked fine for me.  Kevin, try running it using the korn shell ( ksh instead of sh - bourne shell). If you're just trying to grab the date, though, I'd do it like this: #!/bin/ksh THE_DATE=`sqlplus

RE: Unix Q: ksh scripting

2002-07-24 Thread chris . w . johnson
It works for me. Using the following code: #!/bin/ksh #set -x sqlplus /

RE: Unix Q: ksh scripting

2002-07-24 Thread chris . w . johnson
Title: RE: Unix Q: ksh scripting I also assumed you may want the last line (rather than just sysdate) -  grep -v ^$ | sed -n '$p'  solution works for last line too :) -Original Message-From: Richard Huntley [mailto:[EMAIL PROTECTED]]Sent: 24 July 2002 14:49To

RE: Unix Q: ksh scripting

2002-07-24 Thread Thomas, Kevin
I'd just do: $ date ;o) -Original Message- Sent: 24 July 2002 14:49 To: Multiple recipients of list ORACLE-L With the addition of the extra quote...this worked fine for me. Kevin, try running it using the korn shell ( ksh instead of sh - bourne shell). If you're just trying to

Re: Unix Q: ksh scripting

2002-07-24 Thread lembark
># !/bin/ksh ># set -x > sqlplus / < select sysdate from dual; > exit > EOF | tail -1 The close needs to be on a line by itself: ( foo <<- BAR stuff here BAR ) | tail -1; will do what you want. -- Steven Lembark 2930 W. Palmer Workh

Re: Unix Q: ksh scripting

2002-07-24 Thread Ron Thomas
OR # !/bin/ksh # set -x sqlplus / <# !/bin/ksh ># set -x > sqlplus / < select sysdate from dual; > exit > EOF | tail -1 The close needs to be on a line by itself: ( foo <<- BAR stuff here BAR ) | tail -1; will do what you want. -- Steven Lembark

Case Closed: Unix Q: ksh scripting

2002-07-24 Thread Ross Collado
sqlplus / < -Original Message- > From: Ross Collado > Sent: Wednesday, 24 July 2002 14:53 > To: Multiple recipients of list ORACLE-L > Subject: Unix Q: ksh scripting > > > Hi all, > Can any of our Unix gurus here transform my script below to > work properly? &