From 62118552fb5c7c90f11d246e72c5c6e5605b9084 Mon Sep 17 00:00:00 2001 From: Wei-keng Liao Date: Thu, 9 Feb 2023 02:27:45 -0600 Subject: [PATCH] check if WRF_CMAQ is empty first (#1744) TYPE: bug fix KEYWORDS: Makefile, string check SOURCE: Problem: When WRF_CMAQ is empty, it spews the following error message. /bin/sh: line 0: [: -eq: unary operator expected Solution: Check if WRF_CMAQ is empty first. Modified files: M Makefile TESTS CONDUCTED: Yes, the change fixes the error. The Jenkins tests have passed. No effect on other code. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4c5a8f4aba..104faabe33 100644 --- a/Makefile +++ b/Makefile @@ -1026,7 +1026,7 @@ physics : @ echo '--------------------------------------' if [ $(WRF_CHEM) -eq 0 ] ; then \ ( cd phys ; $(MAKE) submodules ; $(MAKE) CF2=" " ) ; \ - if [ $(WRF_CMAQ) -eq 1 ] ; then \ + if [ -n "$(WRF_CMAQ)" ] && [ $(WRF_CMAQ) -eq 1 ] ; then \ @ echo '----------- make cmaq ----------------' ; \ ( rm -f main/libcmaqlib.a; cd cmaq ; $(MAKE) -f Makefile.twoway ) ; \ fi \