diff and comm are not finding difference between two env files
0
votes
1
answer
55
views
I have this env file
- 1.env contents:
BARF_BAG=1
then another env file:
- 2.env contents:
BARF_BAG=2
I run comm and diff on the files to see the difference:
#!/usr/bin/env bash
(
set -e;
first_env_file="$1"
second_env_file="$2"
if ! test -f "$first_env_file"; then
echo 'first arg must be an env file';
exit 1;
fi
if ! test -f "$second_env_file"; then
echo 'second arg must be an env file';
exit 1;
fi
echo -e '\n'
echo -e 'displaying results from diff tool:'
diff <(. "$first_env_file"; env | sort) <(. "$second_env_file"; env | sort) || true
echo -e '\n'
echo 'displaying results from comm tool:'
comm -3 <(. "$first_env_file"; env | sort ) <(. "$second_env_file"; env | sort) || true
echo 'finished diffing env files.'
)
and I get nothing, just:
displaying results from diff tool:
displaying results from comm tool:
finished diffing env files.
what gives?
Asked by Alexander Mills
(10744 rep)
Oct 5, 2023, 05:14 PM
Last activity: Oct 5, 2023, 08:02 PM
Last activity: Oct 5, 2023, 08:02 PM