Bash script to determine a distro, update, upgrade and install the apps I use
Simplifying if-elif-else

The else statement here is dead code, it can never happen:


if [ "$close_distro" = "debian" ]; then
  # commands to run if debian
elif [ "$close_distro" != "debian" ]; then
  # commands to run if NOT debian
else
   echo "This is not for you."
fi



The conditions can be simplified to this:

if [ "$close_distro" = debian ]; then
  # commands to run if debian
else
  # commands to run if NOT debian
fi


I also dropped the unnecessary double-quoting around the literal string debian.

Prefer $(...) over `...`

When using sub-shells, instead the obsolete `...`,
always use the modern syntax $(...).

Simplify a chain of commands with awk when possible

In each of these commands, there are 3 processes executed: cat, grep and another grep:


current_distro=`cat /etc/*-release | grep "^ID=" | grep -E -o "[a-z]\w+"`
close_distro=`cat /etc/*-release | grep "^ID_LIKE=" | grep -E -o "[a-z]\w+"`



You can make that more efficient by rewriting each using a single awk:

current_distro=$(awk -F= '$1 == "ID" { print $2 }' /etc/*-release)
close_distro=$(awk -F= '$1 == "ID_LIKE" { print $2 }' /etc/*-release)