Quote:
Daniel B. Martin |
You can remove the last parentheses (like my edited previous post)
They are not needed and slow down performance (they were left from my trial and error attempts) ps: is it me or there is a forum bug in this page ? (edit: fixed now :)) |
Quote:
Daniel B. Martin |
Quote:
Daniel B. Martin |
Quote:
And you are spawning a subprocess. This script might stop, if there are no more process ids available while the script without the useless use of cat would still work. Admitted a very rare condition. But imagine running the cat construct in a long running loop you WILL see a a heavy performance penalty. I can't get the point of readability. The "grep what where" pattern is to basic to be unreadable imho The more you use the more errors can arise. Are you aware of the buffering mechanism which bash does when it comes to piping? The source of subtle failures. Lucky debugge! Adhere to the KISS KeepItStupidSimple pattern. Do only do what really is required. |
Trying to explain the reg exp...
Code:
(?=(....))..*\1 So with 'ratatat' example Code:
echo ratatat | perl -ne 'print "$1\n" while /(....)/g' Code:
echo ratatat | perl -ne 'print "$1\n" while /(?=(....))/g' |
Quote:
Quote:
Quote:
Daniel B. Martin |
Thanks to everyone who contributed to this thread.
Having received several excellent solutions, this problem will be marked SOLVED! Daniel B. Martin |
All times are GMT -5. The time now is 10:02 PM. |