Instead of putting the list of apps inside the script itself I would like to get the list from another directory. (I read that I can use dirname to do this but I don’t know how). How can I install something using a simple list from the data/fav.list for example? That way I could edit fav.list at any time without messing with the install script. Thank you very much.
#!/bin/bash
PACMAN_INSTALL=(
curl
yay
lsd
bat
duf
fd
)
for app_to_install in ${PACMAN_INSTALL[@]}; do
if ! pacman -Q | grep -q $app_to_install; then
pacman -S "$app_to_install" --noconfirm
else
echo -e "\e[32;1m[DONE]\e[0m - $app_to_install"
fi
done
I don’t know if I’m doing this correctly commenting on a topic already resolved, I’m still learning the rules, but I wouldn’t like to open another topic.
This works when the list is in the same script directory. What if the list was in another directory? e.g.!