rpm shell script
hi all
i have a input text file contain 10 rpms and they are old versions i need a shell script to check if these rpms is installed or not and if the newer version is installed and i need all the results in one output text file contain every rpm and its condition ( the same) or (new )or( not installed) thanks in advance. |
Quote:
If you are expecting someone to write this for you, you're in the wrong place. |
I hope, we can suggest to use yum, apt-get, etc. instead of this scripting
|
Hello and welcome to LinuxQuestions,
Is this by any chance homework? It sure sounds like it. Like TB0ne said, show us what you have written already and where it's failing and we might point you in the right direction. If you're starting out with scripting, read these guides: Bash Guide for Beginners Advanced Bash Scripting Guide Kind regards, Eric |
Hello Everyone,
As i have writen a script which check the rpm installed or not. But instead of enter single rpm i want a file input in which all rpms list which need to check. Please help. thanks in advance #!/bin/bash - uname -rv bash --version rpm --version echo P=${1?" must specify package name."} rpm -qa "$P" > t1 my_size=$( wc -l < t1 ) echo " Size of report file is $my_size lines" if [[ $( rpm -qa $P ) =~ ${P} ]] # if [[ $( rpm -qa $P ) == *${P}* ]] then echo " Package $P is installed." else echo " Package $P not found." fi exit 0 |
All times are GMT -5. The time now is 08:12 PM. |