delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/09/19/09:37:52

From: chet AT odin DOT INS DOT CWRU DOT Edu (Chet Ramey)
Subject: Re: the bash builtin command `if test -n ""' (fwd)
19 Sep 1997 09:37:52 -0700 :
Message-ID: <970919161804.AA09255.SM.cygnus.gnu-win32@odin.INS.CWRU.Edu>
References: <ww01-BiRqoc2104 AT netaddress DOT usa DOT net>
Reply-To: chet AT po DOT cwru DOT edu
Mime-Version: 1.0
To: earnie AT usa DOT net
Cc: gnu-win32 AT cygnus DOT com, chet AT odin DOT INS DOT CWRU DOT Edu

> I have been trying to build and install groff-1.11.  I have found a 
> problem with the builtin command "if" with the following syntax:
> 
>      if test -n "$(tmac-wrap)"; then \
>          for m in $(tmac-wrap); do \
>              ...
>          done; \
>      fi
> 
> bash aborts with "syntax error near unexpected token `;'"
> ... `if test -n ""; then for m in ; do ...; done; fi
> 
> bash shouldn't test the syntax of the "for" command since what is 
> being done is a test to see if the "for" command will execute properly.

That's not true.  All sh-style shells parse entire commands before
attempting to execute them.

> In the mean time: Any ideas on how to easily modify the Makefile.sub 
> for  the "tmac" subsystem to allow "make" to complete?

Add a dummy argument before or after the $(tmac-wrap) in the for command,
or do something like 

      if test -n "$(tmac-wrap)"; then \
	  TMAC_WRAP="$(tmac-wrap)" ; \
          for m in $$TMAC_WRAP; do \
              ...
          done; \
      fi

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, Case Western Reserve University	Internet: chet AT po DOT CWRU DOT Edu
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019