Changing the output in own time display's.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Changing the output in own time display's.
# 1  
Old 09-29-2008
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..
# 2  
Old 09-29-2008
Bug

Quote:
Originally Posted by suri.tyson
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}
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing display format

Hi, My file cat a.txt Sat Nov 27 00:02:00 2010 00:02:00 Usr 27: Login by edi on batch. (452) 00:02:09 Usr 27: Logout by on batch. (453) 00:02:09 Usr 27: Login by edi on batch. (452) 00:02:22 Usr 27: Logout by on batch. (453) 00:02:22 Usr 27: Login by edi on batch.... (3 Replies)
Discussion started by: ganeshanbu
3 Replies

2. Shell Programming and Scripting

Why does the 'pid' keep changing every time?

HI I checked the pid of a process on my machine using this command. ps -ef | awk '/process_name/{ print $2 }' I get the result as 12245 I check it again after 2 mins, I get the result as 12264 I check it again after 2 mins, I get the result as 12289 It keeps on this. How does this pid... (4 Replies)
Discussion started by: ss3944
4 Replies

3. AIX

changing server time

Hi all, we have IBM- AIX 5.2 operating system on that we have our oracle production database and there is daily crontab script for backup. my boss told me to change the server time.if i change the server time by root user does it give problem to any application or script which are... (2 Replies)
Discussion started by: younusdba
2 Replies

4. Shell Programming and Scripting

display changing variable in one place on screen in ksh

Is it possible using just korn shell script to display a variable on the screen that is constantly changing in on place on the screen, to tell it in coordinates or something? In a loop, echo will print a new line each time, can I make it a static position? Thanks (7 Replies)
Discussion started by: raidzero
7 Replies

5. UNIX for Dummies Questions & Answers

Changing display and format of file

I have an input file which looks like this: 601 a 602 a 603 a 601 b 610 c 615 c 603 d 601 d 612 d I need the utput to look like this 601 a 602 603 602 a 601 603 603 a 601 602 601 b 610 c 615 615 c 610 603 d 601 612 (1 Reply)
Discussion started by: wahi80
1 Replies

6. Shell Programming and Scripting

changing modified time

How to change the modified time of a file to any specified time. ls -ltr drwxr-xr-x 2 pipe pipe 4096 Jun 10 10:33 coredump_06062008 ---------------------------------------------------------------------- here file coredump_06062008 last modified time is Jun 10 10:33 and i... (1 Reply)
Discussion started by: ali560045
1 Replies

7. UNIX for Dummies Questions & Answers

How to MV without changing Time Stamp

Hi, I need to move the set of files, and it should be same time stamp as previous. How to do this? (3 Replies)
Discussion started by: redlotus72
3 Replies
Login or Register to Ask a Question