In Bash 4.2.25, the
env output is not escaped, so shell escapes and any non-printable characters won't be copy-pasteable. Take for example this shell session:
$ export foo=$'a\nbar=\baz' $ env | grep -A 1 foo foo=a baraz
Ditto for for example colors - They are printed literally, and can mess up the terminal. How do you print all variables with their values in a way that the output can be copied and pasted to give the same environment?*
* Obviously with the standard caveats about readonly variables, special variables like
$_ and the like.