This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Is there a known problem with using nested sub-shells in bash?


Sat 2003/JUL/05 2134 PDT

Hello,

I am working on porting an imake-based build system from Red Hat 8.0 Linux
to Windows XP using Cygwin 1.3.22, along with ClearCase 5 for Windows (we
use ClearCase 5 on Linux).

I was wondering if there is a known problem with the bash shell in Cygwin
and nested sub-shells in scripts. Our Makefile uses some bash shell commands
that are executed in a nested sub-shell to create all of the Makefiles
necessary for the build. When we run the build, we are getting the following
error:

  /usr/bin/bash: line 2: syntax error: unexpected end of file
  *** Error code 258 (ignored)

As far as I can determine, these errors are occurring when clearmake.exe is
spawning a child and a bash sub-shell is used. What I cannot figure out is
if the error is due to bash in Cygwin or due to one of the commands executed
in the nested sub-shell.

I have looked at the bash shell manual (GNU's web site), but I cannot find
any listing of error codes, nor can I find any in my O'Reilly "Learning the
bash Shell" book. This is making it difficult in trying to figure out what
is causing the "/usr/bin/bash: line 2: syntax error: unexpected end of file"
error, when I can't find a list of error codes.

  <http://www.gnu.org/manual/bash/index.html>

If you could let me know if there are known problems with bash sub-shells in
Cygwin or what "Error code 258 (ignored)" means, I would appreciate it. A
web site with a list of bash error codes and their meaning would be great.



The imake system creates the Makefiles that will be used by the build. Our
build script then calls clearmake (I have to tell it which shell to use,
which I do with SHELL=C:\\cygwin\\bin\\bash.exe) and passes to it the
Makefile to use and the Makefile target. clearmake.exe then reports it is
spawning a child, a nested sub-shell is created, and then the following
error is reported by bash:

This is a snippet of one of our imake-generated Makefiles (specifically for
the "Makefiles" target):

  Makefiles ::
  	-@echo "*-*- In
__RecursivelyMakeMakefilesTargetsInPeerDirs($(PEERDIRS),-f
$(TOP_DIR)/$$i/Imakefile)"
  	-@echo "*-*-  TOP_DIR=$(TOP_DIR)"
  	-@for i in $(PEERDIRS) ; do \
  	if [ -d ../$$i ] ; then \
  	( \
  	echo "Making Makefiles in $(TOP_DIR)/$(CURRENT_DIR)/$$i" ; \
  	$(IMAKE) $(IMAKEOPTS) $(IMAKEDEFS) -s
$(TOP_DIR)/$(CURRENT_DIR)/../$$i/Makefile -DTOPDIR=$(TOP_DIR) \
  	-DCURDIR=$(CURRENT_DIR)/../$$i -f $(TOP_DIR)/$$i/Imakefile ; \
  	cd $(TOP_DIR)/$(CURRENT_DIR)/../$$i ; \
  	$(MAKE) -f Makefile Makefiles ; \
  	) \
  	else \
  	echo "NOTE: Skipping missing directory
$(TOP_DIR)/$(CURRENT_DIR)/$$i" ; \
  	continue ; \
  	fi ; \
  	done


-Michael

Attachment: cygcheck_2003-07-05_2038.txt
Description: Text document

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]