SO, I don’t really know if this is the right spot or not, but I think this is a fairly newbie type question here, so this is where I thought I would post it.
Anyways, this is my issue: I have a script to update Antergos, but I have some added functionalities that it runs afterwards (such as cleaning the cache). So I thought, what if I used an if statement to make it update when updates were available and skip that and go to cleaning the system when they weren’t. Apparently this is harder than I though. This is the if statement I have so far, but it does not seem to be working quite right.
if ((" checkupdates | wc -l" = 0)) then echo "THERE IS NOTHING TO UPDATE" else echo "NEW PACKAGES AVAILABLE" echo "YOUR SYSTEM IS ABOUT TO BE FULLY UPDATED" | yes | sudo fetchmirrors --country US echo echo echo "my_root_password" | sudo -S pacman -Syu --noconfirm yaourt -Syu --aur --noconfirm fi;
If anyone has any suggestions as to how I could fix it up or what I did wrong, that would be appreciated.
Thank you for all of your help in advance!