verify if rpm is installed
Hi Linux guru's
can you please guide me on how to create a single line command that will tell if the pogi.rpm does not exist it will echo "rpm does not exist" and if it does it will simply output the "rpm -qa | grep pogi" I have made this, but didn't work Code:
if [ rpm -qa | grep pogi -eq "" ]; then echo "no pogi installed" else rpm -qa | grep pogi fi |
It wouldn't hurt to learn a bit of shell scripting as this line includes several syntax errors.
http://pubs.opengroup.org/onlinepubs...02.html#tag_18 # the basis http://tldp.org/LDP/abs/html/index.html # explanations for bash, that is a specific shell with many added features "man bash" # to be used as a checklist I advise you to try using only the features provided in the POSIX specification, listed in the first document. |
yum will inform you with a "i" it it is installed or not
Code:
su - unless this is suse then it is "Zypper" or it fedora 22 "DNF" |
Code:
rpm -aq | grep pogi > /dev/null |
If 'pogi' is a programme you can use 'which'.
'which pogi' should give you a reply consisting of a file path to the 'pogi' executable. If you do not have 'pogi' in your system it will reply on the lines of 'no pogi in .....' |
All times are GMT -5. The time now is 02:34 AM. |