I’m trying to rewrite some bash scripts and one of the sections checks if certain rpm’s are installed on the system with a basic if statement
if rpm -qa | grep rpmnamehere; then
do stuff
I want to do something similar in ruby, but am pretty new to this and not sure where to look in the documentation.
Thanks
You can invoke shell command in ruby script, and save output in variable
or only invoke command
so, I think you can solve your problem like this