PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > is this possible?<file processing>
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

is this possible?<file processing>

Réponse
 
LinkBack Outils de la discussion
Vieux 30/08/2007, 07h45   #1
DriVE_mE_cRazY
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut is this possible?<file processing>

Hi all,

I'm a DBA with not much scripting knowledge.I have a situation like
this.

there is a log file call patch.log which has some useful information
for me like for eg:

#############################
#############################
USELESSINFORMATION
#############################
#############################
******Filelist starts here*************
useful information
useful information
******endof Filelist******************
#############################
#############################
USELESSINFORMATION
#############################
#############################
******Filelist starts here*************
useful information
useful information
******endof Filelist******************
like this it goes on.

My requirement is it possible to write a shell script which reads the
patch.log file and extract the useful information which was there in
the log file... means take only the block of the useful information
present here and there in the log file... and generate a new file wit
all these infrmation dumped?.All the useful information starts with
the keyword "Filelist" and ends with "endof Fileslist".Please can any
one ????


regards,
senthil

  Réponse avec citation
Vieux 30/08/2007, 08h18   #2
pgas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: is this possible?<file processing>

On Aug 30, 9:45 am, DriVE_mE_cRazY <k.senthilmuru...@gmail.com> wrote:
> Hi all,
>
> I'm a DBA with not much scripting knowledge.I have a situation like
> this.
>
> there is a log file call patch.log which has some useful information
> for me like for eg:
>
> #############################
> #############################
> USELESSINFORMATION
> #############################
> #############################
> ******Filelist starts here*************
> useful information
> useful information
> ******endof Filelist******************
> #############################
> #############################
> USELESSINFORMATION
> #############################
> #############################
> ******Filelist starts here*************
> useful information
> useful information
> ******endof Filelist******************
> like this it goes on.
>
> My requirement is it possible to write a shell script which reads the
> patch.log file and extract the useful information which was there in
> the log file... means take only the block of the useful information
> present here and there in the log file... and generate a new file wit
> all these infrmation dumped?.All the useful information starts with
> the keyword "Filelist" and ends with "endof Fileslist".Please can any
> one ????
>
> regards,
> senthil



sed -n '/Filelist/,/endof Fileslist/p' patch.log > usefull.log

  Réponse avec citation
Vieux 31/08/2007, 10h19   #3
replytoshishir@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: is this possible?<file processing>

On Aug 30, 11:45 am, DriVE_mE_cRazY <k.senthilmuru...@gmail.com>
wrote:
> Hi all,
>
> I'm a DBA with not much scripting knowledge.I have a situation like
> this.
>
> there is a log file call patch.log which has some useful information
> for me like for eg:
>
> #############################
> #############################
> USELESSINFORMATION
> #############################
> #############################
> ******Filelist starts here*************
> useful information
> useful information
> ******endof Filelist******************
> #############################
> #############################
> USELESSINFORMATION
> #############################
> #############################
> ******Filelist starts here*************
> useful information
> useful information
> ******endof Filelist******************
> like this it goes on.
>
> My requirement is it possible to write a shell script which reads the
> patch.log file and extract the useful information which was there in
> the log file... means take only the block of the useful information
> present here and there in the log file... and generate a new file wit
> all these infrmation dumped?.All the useful information starts with
> the keyword "Filelist" and ends with "endof Fileslist".Please can any
> one ????
>
> regards,
> senthil


ofcorse it is possible but i would like to know more about it..
can a useless line also start with the "Filelist" keyword if not then
the following command can be useful for you the


cat patch.log | sed -n 'Filelist/,/endof Filelist/p' >> newfile



this will contain 2 extra line i.e containing containing
"***********Filelist start here*******************" and
"******************endof Filelist******************"
to avoid this u can use this command provided none of the lines in
between the section contains the keyword "Filelist"


cat patch.log | sed -n 'Filelist/,/endof Filelist/p' | grep -v
"Filelist" >> newfile


thanks & regards

Shishir srivastava

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 08h35.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10966 seconds with 11 queries