On Sat, 4 Jun 2005, Anish Kumar K wrote:

> Isn't there a easy way [to find sendmail] [question-mark]

If you're on a Unix-ish platform, and the sendmail program is installed
somewhere in your $PATH, the `which` command can help. For instance:

    $ which sendmail
    /usr/sbin/sendmail
    $

This is on OSX. It can be other places on other platforms.

If it isn't in your $PATH, then the `locate` command may help. Chances
are, it's going to be in a directory no deeper than three or four levels
down, so we can use `grep -v` to exclude deeper paths:

    $ locate sendmail | grep -v '/.*/.*/.*/.*/'
    /Users/cdevers/bin/update_sendmail
    /usr/sbin/sendmail
    $

This turns it up again, along with a false hit in my home directory.
Chances are you'll get similiar false hits, but hopefully the real one
will be clear enough.

If you don't have the `locate` database on your system, you're going to
have to walk the while filesystem, using something like `find`. Here's
one way to do it, but it will be very, very, very slow:

    $ find / -type f | grep -v '/.*/.*/.*/.*/'

The output from this should be similar to what `locate` would have; with
luck you'll see it in a folder like /usr/lib, /usr/libexec, /usr/sbin,
/usr/local/bin, /opt/bin, et cetera.

Good luck!


-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to