Don't you have to run locate -u first to generate the database before using locate? You can't just assume a database exists already can you? On 4/11/07, Jim Lucas <lists@xxxxxxxxx> wrote:
Mattias Thorslund wrote: > Hi, > > I have looked in the documentation but can't find it: > > My PHP script (which is run from the command prompt - CLI) needs to know > the file system location of the PHP executable. This is because it needs > to run a second PHP script. I know about the "which" command but it's > not available in all OSes, and that might not be the currently running > executable anyway. > > I could prompt the user for this, but that seems kind of silly. Surely, > there must be some way of looking it up automatically? > > Thanks, > > Mattias > What OS are you working with Assuming you are on a *nix box this should work #locate "/php" | grep "/php$" this should give you locations that have /php as the end of the line on windows you could do this cd \ dir /s php*.exe -- Enjoy, Jim Lucas Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree. - Rush -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php