![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search and Parse string from inside a File | SSims | UNIX for Dummies Questions & Answers | 2 | 11-08-2007 12:50 PM |
| how to search string and number in one file and check in the other file | knshree | Shell Programming and Scripting | 9 | 08-24-2007 01:29 AM |
| How to search a string in a file. | prathap | UNIX for Dummies Questions & Answers | 1 | 07-16-2007 11:41 PM |
| appending string to text file based on search string | malaymaru | Shell Programming and Scripting | 1 | 06-09-2006 05:53 AM |
| please help me to search string in a file ...... | swamymns | Shell Programming and Scripting | 2 | 02-01-2006 09:20 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
String search in log file
Hi all!
I have a log file from an incremental backup. This next script I've done works when the backup completes in the same day it started. But if the backup goes on to the next day, this one doesn't work anymore. ################################## #VARS data=`date '+%m/%d/%y'` directoria='/var/local/logs/backup' ################################### select versao in diario semanal mensal do case $versao in diario) grep $data $directoria/dsmsched_diario.log > $directoria/back.log;; semanal) grep $data $directoria/dsmsched_semanal.log > $directoria/back.log ;; mensal) grep $data $directoria/dsmsched_mensal.log > $directoria/back.log;; *) print "As opcoes sao 1,2 e 3"; break;; esac done more $directoria/back.log rm $directoria/back.log Log file looks like this 07/05/06 23:58:17 Normal File--> 1,048,580,096 /ONLINE/u03/oradata/HIST_EI /eigraciosatab01.dbf [Sent] 07/05/06 23:59:41 Normal File--> 1,048,580,096 /ONLINE/u03/oradata/CTTSITE /moverstab01.dbf [Sent] 07/06/06 00:00:09 Normal File--> 734,007,296 /ONLINE/u03/oradata/EI_PDL/ eitab01.dbf [Sent] 07/06/06 00:00:34 Normal File--> 209,719,296 /ONLINE/u03/oradata/CTTSITE /questtab.dbf [Sent] delete |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
I've solved... I used egrep command. egrep let use two strings in same command. Tkz anyway
|
|||
| Google The UNIX and Linux Forums |