How to find if a specific application exists at a given path

Discussion in 'Mac Programming' started by swimlikehell, Apr 11, 2008.

  1. macrumors member


    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.
  2. macrumors 65816

    Using an sh shell script you can do something like:

    if [ -f "/my/lost/app" ]
        echo "found it! :)"
        echo "didn't find it :("
    The if statement just tests to see if the file specified exists. You can also look at the find command.

Share This Page