when I call env to see the environment variables it shows nicely with new lines:
$ env
SHELL=/bin/sh
EDITOR=vi
PWD=/home/user
...
but when I want to store this to a file the new lines get discarded:
$ echo $(env) > root.env
SHELL=/bin/sh EDITOR=vi PWD=/home/user ...
What goes wrong? how can I store the env output with each item on a line?