> while read line; do export "$line"; done < /etc/environment > > I don't know if Guix even cares about non-bash shells, but this should™ > work in all POSIX®-compliant ones[4]. It's also more readable. > > Thoughts? Gotchas?
Spaces in keys and/or values don't work that way. The read itself already has problems with them. You might try setting IFS=" " but not sure whether that's standards-compliant. Also, does csh actually support "export"? The one I have in Solaris doesn't. You need to do "setenv" there.