# not tested: # multilog handles TERM # multilog handles ALRM # multilog handles out-of-memory # multilog handles log directories # multilog matches only first 1000 characters of long lines # multilog t produces the right time # multilog closes descriptors properly echo '--- multilog prints nothing with no actions' shell { echo one; echo two } | multilog; echo $Status echo '--- multilog e prints to stderr' shell { echo one; echo two } | multilog e !2 > !1; echo $Status echo '--- multilog inserts newline after partial final line' shell { echo one; echo two | tr -d '\012' } | multilog e !2 > !1; echo $Status echo '--- multilog handles multiple actions' shell { echo one; echo two } | multilog e e !2 > !1; echo $Status echo '--- multilog handles wildcard -' shell { echo one; echo two } | multilog '-*' e !2 > !1; echo $Status echo '--- multilog handles literal +' shell { echo one; echo two } | multilog '-*' '+one' e !2 > !1; echo $Status echo '--- multilog handles fnmatch -' shell { echo one; echo two } | multilog F '-*' e !2 > !1; echo $Status echo '--- multilog handles fnmatch +' shell { echo one; echo two; echo one two } | multilog F '-*' '+*o*' e !2 > !1; echo $Status echo '--- multilog handles long lines for stderr' echo 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 \ | multilog e !2 > !1; echo $Status echo 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 \ | multilog e !2 > !1; echo $Status echo 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 \ | multilog e !2 > !1; echo $Status echo '--- multilog handles status files' rm -f test.status shell { echo one; echo two } | multilog =test.status; echo $Status uniq -c < test.status | sed 's/[ ]*[ ]/_/g' echo '--- multilog t has the right format' shell { echo ONE; echo TWO } | multilog t e !2 > !1 | sed 's/[0-9a-f]/x/g'