compare.sh
· 718 B · Bash
Raw
#!/usr/bin/env bash
#
# compare_packages.sh
#
# Compare package lists from two systems:
# anduinos-packages.txt
# ubuntu-24-packages.txt
# Ensure both files exist
if [[ ! -f "anduinos-packages.txt" || ! -f "ubuntu-24-packages.txt" ]]; then
echo "Error: One or both package list files are missing."
echo "Please make sure anduinos-packages.txt and ubuntu-24-packages.txt are present."
exit 1
fi
echo "===== Packages installed on anduinos but NOT on ubuntu ====="
comm -23 <(sort anduinos-packages.txt) <(sort ubuntu-24-packages.txt)
echo
echo "===== Packages installed on ubuntu but NOT on anduinos ====="
comm -13 <(sort anduinos-packages.txt) <(sort ubuntu-24-packages.txt)
echo
echo "Comparison done."
1 | #!/usr/bin/env bash |
2 | # |
3 | # compare_packages.sh |
4 | # |
5 | # Compare package lists from two systems: |
6 | # anduinos-packages.txt |
7 | # ubuntu-24-packages.txt |
8 | |
9 | # Ensure both files exist |
10 | if [[ ! -f "anduinos-packages.txt" || ! -f "ubuntu-24-packages.txt" ]]; then |
11 | echo "Error: One or both package list files are missing." |
12 | echo "Please make sure anduinos-packages.txt and ubuntu-24-packages.txt are present." |
13 | exit 1 |
14 | fi |
15 | |
16 | echo "===== Packages installed on anduinos but NOT on ubuntu =====" |
17 | comm -23 <(sort anduinos-packages.txt) <(sort ubuntu-24-packages.txt) |
18 | |
19 | echo |
20 | echo "===== Packages installed on ubuntu but NOT on anduinos =====" |
21 | comm -13 <(sort anduinos-packages.txt) <(sort ubuntu-24-packages.txt) |
22 | |
23 | echo |
24 | echo "Comparison done." |
25 |