Reading telemetry data and applying an action
I have the following line that reads telemetry data from a logfile when File: or + is encountered. I am setting the variable action to either continue or break, then running the command after the last + entry. It seems a bit confusing when the action gets executed upon reaching (*). What can I do to make the intent clear?
Code:
|
The *) matches anything so your loop will break for any line after action=break but you have set action="break" for both File:) and +) cases. If you want to break at a + then why not just break at the +) case.
Quote:
|
The action=break does not execute the action, only when reaching *) do the commands continue and break execute.
One can either have Code:
File: Value Code:
File: Value If + is encountered, I will read through all subsequent values until the last + in encountered. |
Does it work as expected?
|
I feel it is implemented in a weird way.
|
If it is commented enough then you should be able to come back 2 years from now and be able to understand how it works. You could do the same thing with an if-then-else too.
|
All times are GMT -5. The time now is 04:24 PM. |