I'm trying to match a multiline pattern in a program's output.
I've got a shell script that runs from cron. It has some output.
Normally it's pointless, and clutters my mailbox.
I've determined that if the program runs properly, the output will
match the following:
/dev/disk.*FDisk_partition_scheme
/dev/disk.*/Volumes/XcomQemu
sending incremental file list
sent.*
total size is.*
"disk." unmounted.
"disk." ejected.
Note the following:
1. It's multiple lines.
2. It has "." and ".*" (only).
I've looked at expect, and grep(1), re_format(7), and regex(3). Expect
doesn't seem to like multiple lines of matching. Nothing in the grep
family indicates anything about searching for a newline in the middle
of a pattern -- at best, the "patterns in a file" give one pattern per
line.
So what's the best way to test the output of one command against an
expected behavior? If something goes wrong, I want to see it; if
nothing goes wrong, I don't want to see anything.
(If you're curious, it's mounting a virtual hard drive, rsync'ing the
data of interest into an HFS+ directory, and then unmounting it. I
don't want time machine copying a large virtual hard drive when the
files of interest are tiny.)
Michael
---
PGP/GPG accepted; key 25D85CE0
Political and economic blog of a strict constitutionalist
http://StrictConstitution.BlogSpot.com
_______________________________________________
MacOSX-talk mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-talk