[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A quick, stupid question.
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