Hello Forum,
I'm issuing a one line bash command to look for the version of an installed application and saving the result to a variable like so:
APP=application --version
But if the application is not installed I want to return to my variable that the Application is not installed. So I'm looking for a command something like the following:
APP=application --version && echo "Application is not installed";
Or perhaps a better way to find this would be to look at when the application was installed using:
rpm -aq --last | grep <application>
Where I would again want the result to show either the app installed version and date and if not found return the text "Application is not installed".
What is the correct syntax of this one line command to gather the information I need into my $APP variable?
Thank you.