1 2 3 4 5 6 7 8 9 10 11
#!/bin/bash offlineimap='offlineimap' output_file="`mktemp`" $offlineimap "$@" 2>&1|tee "$output_file" [ -z "`grep 'ERROR:' "$output_file"`" ] status=$? rm "$output_file" exit $status