Fix export syntax of $GREP_OPTIONS

Fixes #2641, #2642