I want to write code that reads a list of packages from an array and tells me whether the corresponding RPM is installed:
ARRAY=(
pkg-config
python
python-devel
python-libs
readline
renderproto
sqlite
tcl
tk
zlib
)
for i in `echo ${ARRAY[@]}`
do
rpm -q $i
done
This code doesn't work properly. I want the output to be ok rpm named
foobar is installed
or rpm named foobar is not installed
.
How can I do this?