Sponsored Content
Top Forums Shell Programming and Scripting Checking whether program is installed Post 302293128 by figaro on Monday 2nd of March 2009 12:35:41 PM
Old 03-02-2009
Checking whether program is installed

I currently use this construction to check whether a certain program is installed:
Code:
if [ ! -e `which sqlite3` ]; then
        cd /usr/ports/databases/sqlite3 && make install clean
else 
        echo "sqlite already installed"
fi

Is this method recommended? Is this an effective method, ie sufficiently robust for other examples, such as gcc, php, perl etc? Are there any caveats to this? The snippet is run as part of a script as root.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to know the program 'perl' is installed ?

Hi, How can I know the perl interpreter is installed in the system? When I type 'find / -name perl -print 2>/dev/null', there is 6 lines listing: /usr/local/bin/perl /usr/bin/perl /usr/lib/perl-5.8.0/bin/perl /usr/opt/IAFW310/PERL/perl /usr/opt/IAFW310/PERL/t/perl... (3 Replies)
Discussion started by: zp523444
3 Replies

2. UNIX for Dummies Questions & Answers

Checking which databases are installed

I want to check which databases are installed on my FreeBSD installation. This is what I did: pkg_info | grep mysql How do I check all in one go whether also sqlite, postgresql, firebird is installed? Thanks in advance (3 Replies)
Discussion started by: figaro
3 Replies

3. HP-UX

how to package my program which can be installed on HP UX

I develop a unix program in HPUX I want to package my program to install on HPUX in some dierctory folder like /user/local/sbin/xxx and preinstall some software before install my program package like xxx.depot how can i do it, have any tools like use setupfactory tools in windows ... (4 Replies)
Discussion started by: alert0919
4 Replies

4. UNIX for Advanced & Expert Users

Checking mem usage at specific times in a program

Hi all, I'm running a simulator and I'm noticing an slow increase in memory for long simulations such that the simulation has to end because of a lack of memory. A colleague of mine ran Valgrind memcheck and reported that nothing of interest was reported other than known mem leaks. My advisor... (2 Replies)
Discussion started by: pl4u
2 Replies

5. Shell Programming and Scripting

checking which mysql dbd is installed on linux

Hi, I am new to linux, and i want to know which mysql dbd is installed on linux, what is the command to check this. bash-2.05$ uname -a Linux SURINT01 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686 unknown Thanks Prakash GR (6 Replies)
Discussion started by: prakash.gr
6 Replies

6. Shell Programming and Scripting

awk columnwise adjacent match checking program

Hi, For the below problem, awk script is needed.. input file : jill jack jill jill jack jill jack jill Required: here, i need to check from first line. reference is jack. jill need to verified with next line jack. if found print jill & jack combination hill1 jack & jill &... (0 Replies)
Discussion started by: vasanth.vadalur
0 Replies

7. Ubuntu

How to list my program or package that i compile and installed?

Hi I would like to ask in ubuntu or linux on how to list all my package or software the i installed via source code( compile installed in dir default is /usr/local) just like i solaris in which if you installed a package in ur choosing default root installation dir you can just issue a command... (2 Replies)
Discussion started by: jao_madn
2 Replies

8. UNIX for Dummies Questions & Answers

Short Program for Checking Server date

Hi Guys, Good morning! I have a file which looks something like this: Command was launched from partition 0. ------------------------------------------------ Executing command in server server3 Thu Jan 12 11:10:39 EET 2012 ------------------------------------------------... (3 Replies)
Discussion started by: rymnd_12345
3 Replies

9. Shell Programming and Scripting

Program to combine two lines in a file on checking the first character of each line

Hi, I have a requirement where I need to combine two lines in a file based on first character of each line in a file. Please find the sample content of the file below: _______________________ 5, jaya, male, 4-5-90, single smart 6, prakash, male, 5-4-84, married fair 7, raghavi, female,... (12 Replies)
Discussion started by: jayaP
12 Replies

10. UNIX for Beginners Questions & Answers

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: 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... (2 Replies)
Discussion started by: greavette
2 Replies
LR_ENV.IN(1)						  LogReport's Lire Documentation					      LR_ENV.IN(1)

NAME
lr_env - Gives information on the location of the current Lire installation SYNOPSIS
eval `lr_env ` DESCRIPTION
lr_env prints on STDOUT shell code which can be evaled to access information on the Lire installation. The following variables are printed: LR_PREFIX The prefix where Lire is installed. LR_LIBDIR The directory where the supporting scripts are installed. LR_SYSCONFDIR The directory where configuration files are installed. LR_BINDIR The directory where user binary are installed. LR_MANDIR The directory where man pages are installed. LR_PLUGINSDIR The directory where Lire::Plugin initializers are installed. LR_SCHEMASDIR The path where DLF schemas are installed. LR_REPORTSDIR The path where report specifications are installed. LR_FILTERSDIR The path where filter specifications are installed. LR_DOCDIR The directory where documentation is installed. LR_SPECSDIR The path where XML configuration specifications are installed. LR_TEMPLATESDIR The path where XML report templates are installed. LR_PERL5LIBDIR The directory where platform independant perl modules are installed. VERSION
$Id: lr_env.in,v 1.7 2006/07/23 13:16:32 vanbaal Exp $ COPYRIGHT
Copyright (C) 2002 Stichting LogReport Foundation LogReport@LogReport.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. AUTHOR
Francis J. Lacoste <flacoste@logreport.org> POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 106: You forgot a '=back' before '=head1' Lire 2.1.1 2006-07-23 LR_ENV.IN(1)
All times are GMT -4. The time now is 04:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy