Looking for a bit of help as I can't get this to work. I want to test if
apt is installed on the system and then create aliases for it if so.
I came up with the following command, but it doesn't work, as I've determined that the
[ ] is coming up true, no matter if
apt is there or not.
if [ -x $(which apt) &> /dev/null ]; then alias ai='sudo apt install'; alias ar='sudo apt remove'; alias as='apt search'; alias ah='apt history'; alias au='sudo apt update && sudo apt upgrade'; fi # apt
I want the aliases to be created only if
apt is there. Can you think of the correct test that I should be using?