help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

suppressing shell error output


From: Martin Sebor
Subject: suppressing shell error output
Date: Tue, 13 Sep 2005 15:30:49 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050716

Is there an efficient way to suppress the error output of the shell
in the $(shell) function?

In the conditional below, the command foo may not exist. I would like
to silence the error issued by the shell in this case.

  ifeq ($(shell foo >/dev/null 2>&1 && echo $?),0)
  ...
  endif

I managed to silence the error message by re-executing the shell but
that seems like an inefficient hack.

  ifeq ($(shell /bin/sh -c foo >/dev/null 2>&1 && echo $$?),0)
  ...
  endif

Thanks
Martin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]