I have two env files, let's say x.env and y.env, the order of the variables is different, but the content could be the same but likely different.
Is there some tool I could use to diff the variables?
env -i (
# clear all envs
source x.env;
env | sort > x.sh
)
env -i (
# clear all envs
source y.env;
env | sort > y.sh
)
diff x.sh y.sh
is that just about the best way? if there are multiple ones missing, it might make diffing noisy and not very useful, whereas comparing variable names one-by-one might be better..
man commmay be of some help on your sorted files. Good luck.diff -u, the reports of deleted variables should be readable. They will appear as lines prefixed with-(minus). There is syntax coloring support for that in editors. Plus you have other options for diff tools, likemeldor whatever.diffin your solution. Make itdiff -ufor something that is easier to read.