Quantcast
Channel: openSUSE Forums
Viewing all articles
Browse latest Browse all 40713

bash script if then else

$
0
0
Hey people!

I started scripting a few days ago and now i wanna write a script for updating my system with zypper.
But i'm having some troubles. Loading the repositories and refreshing them works, but now i want that
zypper shows me the available updates. And then if there are no new updates you can exit by pressing
ENTER or you press ENTER and update what has to be updated.

My problem now is how do i get the value of zypper -list-updates for the if-condition?

it should look something like:

if[zypper -lu == "no updates"]
then
echo "no updates"
else
zypper update
fi

with the red marked thing i have a problem.
i'm glad for every kind of help

cheers

Viewing all articles
Browse latest Browse all 40713

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>