LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-30-2005, 12:55 PM   #1
gmitra
LQ Newbie
 
Registered: Jun 2002
Location: Slovak Republic
Distribution: RedHat, Mandrake, Gentoo
Posts: 25

Rep: Reputation: 15
How to check installed program in system?


Hello,
I need a simple script to check if program has been already installed
in system. How can I do it? I lost in complicated, for me, configure
files
Thanks.
 
Old 01-30-2005, 02:04 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
just see if it exists.... isn't that good enough? check, say, the return code from "which programname".
Code:
kermit root # which pants
which: no pants in (/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:[...]:/usr/qt/3/bin)
kermit root # echo $?
1
kermit root # which bash
/bin/bash
kermit root # echo $?
0
 
Old 01-30-2005, 03:22 PM   #3
gmitra
LQ Newbie
 
Registered: Jun 2002
Location: Slovak Republic
Distribution: RedHat, Mandrake, Gentoo
Posts: 25

Original Poster
Rep: Reputation: 15
Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
An error Occurred during the file system check. Dropping you to shell; the system wil aneikei Linux - Newbie 3 02-11-2010 07:38 PM
check if selinux is installed linuxmandrake Debian 10 09-27-2005 05:05 PM
How do I check what wm I have installed. mlsbraves *BSD 12 12-08-2004 10:25 PM
How do I check if Apache is installed? jmg1894 Linux - Newbie 4 07-15-2004 02:23 PM
comand to check if program is installed or not? awlad Linux - Newbie 10 05-18-2003 09:34 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration