Hi
I have a C program that has the following line
Code:
if (system("rpm -qa | grep rpm_name > /tmp/version.txt") == 0)
{ //do stuff
}
else
{ //do something else
}
What i want to be able to do is test if a certain rpm is installed on the machine by writing the result of the above to version.txt.
What i am finding is that the rpm is being written to the version.txt file but it does not do into the
if but into the
else when it should be going into the
if.
Have a got the wrong return value??
thanks
Tara
edit: sorry just released that this should probably go in programming?