The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-29-2008
suri.tyson suri.tyson is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 20
Changing the output in own time display's.

Hi all, I've written a script which collects some information and sendsout a mail.. (code pasted below)

ssh -l ora${sid} ${primaryhost} "tail -50 /oracle/$ORACLE_SID/newbackup/END_BACKUP.log" |grep 'insert' |tail -1| awk '{print $7}' >> ${RESULTFILE}

Output would look like this: ('20080920212141','net','Q05','DB','0','20080921064023','netbackup','netbackup')

Now i want to display only the time start & end time with return code "0" in the middle of the line as one of the format below.

2008/09/20/ 21:21:41
Sat Sep 20 21:21:41

How do i do this..?

And in the script am greping for word 'insert' and taking the last line and again doing Print $7.. do this am able to get the whole things which is in (******)... but i dont want all the information.

Can someone please help me how to do this..

Thanks in advance..