
- Image via Wikipedia
| perl -n -e 'print "$_" if 1 ... /<regex>/;# This command line will display the output of , from the first line of output, until the first time it sees a pattern matching .
You could specify the regex pattern /^$/ to look for the first blank line,
or /^foobar/ to look for the first line that starts with the word foobar.
by David Winterbottom (codeinthehole.com)
There are couple of other ways you can do so, like using sed, awk.
<command> |sed –quiet ‘/svn_/,$ !p’
Related articles by Zemanta
- Using Regular Expressions – Part 2 of 4 – Regex in PHP (geekology.co.za)
- Implementing text pattern matching languages in LLVM (ianloic.com)
| Hot: |
You are welcome to my blog. Please feel free to share your Good or Bad experiences with me through comment or through email.
related post
Facebook comments:
1 Comment »
RSS feed for comments on this post. TrackBack URL

















![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_b.png?x-id=13a6a746-2174-4fbd-a2fd-5e14f610ce9c)








Excellent and very thoughtful post! I really appreciate the time and effort you put in every single one of your posts, and finally decided to drop a comment on one of them! If you got some extra time on your hands and looking to improve your search engine rankings in the new Google Caffeine search results take a look at the Google Caffeine eBook…
Anyways, good luck on your blog, and feel free to check out : Google Caffeine
Thanks so much!
All the best,
Dino Vedo
[Translate]