Subject: Re: sh "if foo -qe bar"???
To: None <>
From: Jan Schaumann <>
List: tech-pkg
Date: 06/17/2003 21:13:55
Michael South <> wrote:
> OK, I give up. How the blazes does this work?
>    if ! ${PKG_INFO} -qe "${PKGNAME}" ; then blah blah blah
> (a) Why doesn't it have brackets ([, ]) around the conditional?

Because a command is executed.

> (b) What is "-qe" supposed to do?

Passed the command-line arguments "-qe" to the command "${PKG_INFO}".

> (c) Why does it work within make and not interactively?

Because only when using bsd make within pkgsrc is the variable
"${PKG_INFO}" defined.

But it would work with other variables as well.  Behold:

$ export PKG_INFO=false
$ if ! ${PKG_INFO} ; then echo "true"; fi


-- -
         Multiarchitecture OS, no hype required.