Is it possible to set environment variables with export in Fish Shell? I am working on a project that configures variables this way and it does not make sense to maintain a separate configuration file just for fish.
Consider this example in bash:
echo -e "foo=1\nfoobar=2\n" > foo; export $(cat foo | xargs); env | grep foo
In fish shell, it appears that it will only set a single variable, and only if there is one variable in the file:
~ $ echo -e "foo=3\nfoobar=4" > foo; export (cat foo | xargs); env | grep foo
~ $ echo -e "foo=3" > foo; export (cat foo | xargs); env | grep foo
Is this just a flaw / omission in the Fish implementation of export?
This question is similar to but different from these other two posts: