OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Greg Thomas (ethantpacificnet.net)
Date: Thu Feb 01 2001 - 23:10:34 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    On Thu, 1 Feb 2001, C. Bensend wrote:

    >
    > I'm simply trying to check for the presence of an
    > OpenBSD package - if it's installed, I need to skip the
    > download/installation of that package.
    >
    > I tried:
    >
    > if [ -e `which wget` ]; then
    > echo "wget already installed - skipping"
    > fi
    >
    > ... which works fine, IF the package is installed. If it
    > is not, it fails with (I'm just trying via commandline -
    > I thought that if the package is NOT installed, it would
    > simply output nothing):
    >
    > [: too many arguments
    >
    > What is the flaw in my logic?

    In OpenBSD if the executable doesn't exist which will tell you that, hence
    the "too many arguments".

    $ which blah
    blah: Command not found.

    Greg