Re: how to find the first occurence of an specific text starting
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Shell > Re: how to find the first occurence of an specific text starting




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: how to find the first occurence of an specific text starting  
Michael Tosch


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-31-05 08:01 AM

John Savage wrote:
> Stephane CHAZELAS <this.address@is.invalid> writes:
> 
>
>
> If speed is important, sed might have an advantage here:

sed -n '/Link/h;${g;p;}' /var/log/messages

>
> sed -n '/ Link /h;${g;/./p;}' /var/log/messages

is equivalent to

awk '/ Link /{l=$0}END{if(l!="")print l}' /var/adm/messages


--
Michael Tosch @ hp : com





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:22 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register