Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

swimlikehell

macrumors member
Original poster
Aug 31, 2006
46
0
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.
 
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:

Code:
#!/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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.