4 ms·
That is way over-engineered for something that could be done with a 10 lines of bash: diff2mail() { a=$($@) while true; do b=$(
by aexaey 11y ago
That is way over-engineered for something that could be done with a 10 lines of bash:
diff2mail() {
a=$($@)
while true; do
b=$($@)
if [ "$a" != "$b" ]; then
echo "$a -> $b" | mail -s "$@ changed" 'root@example.com'
return
fi
sleep 1
done
}
diff2mail ls /tmp
And for a lot of stuff it's even shorter than that:
make && x="is done" || x="has failed"; echo "build $x" | mail root
- zwischenzug 11y agoDid you actually read the README?
- aexaey 11y agoYes; together with the actual code, weird concept of "COMMON WORDS THRESHOLD PERCENT" (original author's capitalization), and a cursory look across imported library by the same author and its scant documentation. Is there something in particular, apart from generous amounts of gratuitous complexity, that you would like to point reader's attention at?