PDA

View Full Version : How to find if a specific application exists at a given path




swimlikehell
Apr 11, 2008, 10:47 AM
Hello,

I am trying to find one of two things, either given a path find if a application exists at that path. Or If I can search an entire comp for an application and retrieve its path. If any one has any suggestions on either of these it would be much appreciated.



psingh01
Apr 11, 2008, 02:08 PM
Hello,

I am trying to find one of two things, either given a path find if a application exists at that path. Or If I can search an entire comp for an application and retrieve its path. If any one has any suggestions on either of these it would be much appreciated.

Using an sh shell script you can do something like:


#!/bin/sh

if [ -f "/my/lost/app" ]
then
echo "found it! :)"
else
echo "didn't find it :("
fi


The if statement just tests to see if the file specified exists. You can also look at the find command. http://unixhelp.ed.ac.uk/CGI/man-cgi?find