Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Bash find version of an installed application but if none is found set variable to App Not Installed Post 303040309 by greavette on Saturday 26th of October 2019 10:54:59 AM
Old 10-26-2019
Bash find version of an installed application but if none is found set variable to App Not Installed

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:

Code:
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:

Code:
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:

Code:
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.
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to find who installed an app

Hi, how could I find whether an application is installed by root or non-root I am assuming it would be logged in a file, if it is where would it be? Thanks in advance. (2 Replies)
Discussion started by: dtamminx
2 Replies

2. UNIX for Advanced & Expert Users

How to Find the OS version Installed

Hi, I wanted to know how can I get the version of underlying HP-OS installed on a HPUX workstation. The output required is "June 2001" version or "March 2003" version etc whatever OS is present. Thanx in advance for your help. Regards, Pankaj (3 Replies)
Discussion started by: pankschawla
3 Replies

3. AIX

MAN not found or not installed ??? Need help

Hello, I have installed my system AIX5.3 through NIM. The manual doesn't work. Do you have any idea ? Below my confid. There a specific fileset missing ? Thanks in advance for your help # man ls Manual entry for ls not found or not installed. # lslpp -l bos.rte.man Fileset ... (0 Replies)
Discussion started by: touny
0 Replies

4. Shell Programming and Scripting

How to run an application installed in another unix pc?

Do you guys have any suggestions? hpterm -e rlogin <another unix pc> ??? (1 Reply)
Discussion started by: jehrome_rando
1 Replies

5. Red Hat

Trouble with installed / not installed rpm unixODBC/libodbc.so.1

Hey there, i run 1: on my server (RHEL 6) and getting response that the libodbc is not installed. If i use yum for installation, it tells me, there is no package like this ( 2: ). Since in the description of Definiens is mentioned that the Run-time dependency is unixODBC (libodbc.so.1), I assume... (2 Replies)
Discussion started by: rkirsten
2 Replies

6. Shell Programming and Scripting

installed java version ?

Hi, I want to know what version of the java is installed? Please let me know the command or process to identify the installed java version in sun solaris box. Thanks in advance for all your support. (3 Replies)
Discussion started by: sridhardwh
3 Replies

7. HP-UX

List of installed application on HP-UX

Hi All, I am trying to list down all the installed application/packages on hp-ux machine in below format : packagename:<application/package name> ; <application/package version> ; <application/package vendor> can someone suggest with small script for this.Will swlist command give... (4 Replies)
Discussion started by: omkar.jadhav
4 Replies

8. AIX

Username and installed application on AIX.

Hi, I am looking to get a list of applications and corresponding user who installed the same (owner) on AIX host. Can anyone confirm how can this information be retrieved? We can use "rpm" to get list of packages available on AIX, but is there a way to get the corresponding user as well for... (2 Replies)
Discussion started by: Vipin Batra
2 Replies
asupgrade(1m)						    Application Server Utility						     asupgrade(1m)

NAME
asupgrade - migrates the configuration of a previously installed Sun Java System Application Server SYNOPSIS
asupgrade [-c | --console] [-V --version] [-h | --help]-s | -source applicationserver7.x_installation -t --target application- server8.x_installation [-d | --domain domain_name -n | --nsspwdfile NSS_password_filepath -j | --jkspwdfile JKS_password_filepath -p | --capwdfile CA_password_filepath] Use the asupgrade utility to migrate the server configration and its persisted state, J2EE services, and deployed J2EE applications. The configuration of an installed Sun Java System Application Server 7 is migrated to the Sun Java System Application Server 8 Application Server installation. If the domain contains information about a deployed application and the installed application components do not agree with the configuration information, the configuration is migrated as is without any attempt to reconfigure the incorrect configurations. asupgrade migrates the configuration and deployed applications of a previous version of the Application Server; however, the runtime bina- ries of the server are not updated. Database migrations or conversions are beyond the scope of the asupgrade command. Only those instances that do not use the Sun Java System Web Server specific features will be upgraded seamlessly. Configration files related to HTTP path, CGI bin, SHTML, and NSAPI plugins will not be upgraded. The upgrade process can also be initiated automatically at installation time using the Upgrade checkbox in the Application Server install- er. After completion of the upgrade, use the Application Server 7 Uninstaller to remove the previous version of the Application Server. Application archives (.ear) and component archives (.jar, .war, .rar) that are deployed in the Application Server 7 environment do not require any modification to run on Application Server 8. However applications and components deployed in the source server are repackaged into new J2EE archives in the target server's autodeploy directory and are deployed upon server startup. Applications that do not deploy successfully, must use Migrationtool (asmigrate) on the application and then manually redeploy the application. You must specify the source and target directories for the upgrade. If the upgrade includes certificates, you must also provide the pass- words for the source PKCS12 file and the target JKS keyfile for each domain that contains certificates to be migrated. Since Application Server 7 uses a different certificate store format (NSS) than Application Server 8 (JSSE), the migration keys and certificates are con- verted to the new format. Upon successful upgrade, an upgrate report is generated listing successfully migrated items along with a list of the items that could not be migrated. OPTIONS
-c --console launches the upgrade command line utility. -V--version displays the version of the UpgradeTool. -h--help displays the arguments for launching the UpgradeTool. -s--source identifies the installation directory for Sun Java System Application Server 7. -t--target identifies the installation directory for Sun Java System Application Server 8. -d--domain identifies the destination domain name for the migrated certificates. -n--nsspwdfile identifies the path to the NSS password file. -j--jkspwdfile identifies the path to the JKS password file. -p--capwdfile identifies the path to the CA certificate password file. EXAMPLES
Example 1: Using asupgrade example% upgrade -s /home/sunas7 -t /home/sunas8 SEE ALSO
asmigrate(1M) Sun Java System Application Server March 2004 asupgrade(1m)
All times are GMT -4. The time now is 04:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy