Thanks for all the Comments!
First, the chomping did its part, now my program at least works with each serial i put in the text file instead of just the first.
Second, using system instead of exec, well i started with system, then read that it didn't return from execution (or at least i thought i read it) and then turned to exec. Seemingly, i was wrong :)
Third, i tried the -F -f option with grep, but this did not achieve my goal.
My new problem is this: when i execute the program, the output looks like:
Now Processing #1
.log: No such file or directory
Now Processing #2
.log: No such file or directory
Now Processing #3
.log: No such file or directory
and so on. The rogue line is this one (clearly):
system("echo grep $serial logs* > $serial.log")
This line used to work when i used exec, but with system it doesn't. Any hints on how to solve this problem?
And by the way: the speed you guys show is amazing :) I never expected so much as simple replies until tomorrow, but you came up with real solutions almost instantly. Respect!
greetings, Elbarto
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.