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 -->
  #2 (permalink)  
Old 09-29-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,889
Smile

Quote:
Originally Posted by suri.tyson View Post
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
Pipe the last line through sed:

Code:
sed 's/\([0-9][0-9][0-9][0-9]\)\([0-9][0-9]\)\([0-9][0-9]\)\([0-9][0-9]\)\([0-9][0-9]\)\([0-9][0-9]\)/\1\/\2\/\3 \4:\5:\6/'

Quote:
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.
Change to :
Quote:
| awk '/insert/ { print $7 }' |tail -1 |sed (see above) >> ${RESULTFILE}