Yeah, that's how I have it setup currently. For that though, should I use a "foreach" loop to cycle through the lines of the output and look for certain output, or what do you think would be the best way to go about that? | [reply] |
The correct solution depends strongly on what the script is outputting. I would note that backticks return a scalar, so a foreach would be kinda pointless without splitting or some such. Likely the best choice is to think about what is different about successful vs. failing executions and craft a regular expression to check the output string whole hog. We could help with that if you gave us sample outputs for success and failures.
| [reply] |
Basically, the output that I would be looking for that returns from the other commands is:
XX files copied (where XX is a number)
Restored successfully
If I run the commands in backticks, and have that placed in an array, like @output = `command`, would it then be best to do a foreach loop to look for that output?
| [reply] |