www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/04/11/14:26:57

Message-Id: <200004111902.PAA07351@qnx.com>
Subject: Re: Porting problems with Sh-utils (beta)
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Tue, 11 Apr 2000 15:01:52 -0400 (EDT)
From: "Alain Magloire" <alain AT qnx DOT com>
Cc: djgpp-workers AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.1000411132114.4929E-100000@is> from "Eli Zaretskii" at Apr 11, 2000 01:21:34 PM
X-Mailer: ELM [version 2.5 PL0b1]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 
> 
> On Mon, 10 Apr 2000, Alain Magloire wrote:
> 
> > Sorry, I did not follow the thread(no email for a while)
> 
> You could find it by searching at this URL:
> 
>   http://www.delorie.com/djgpp/mail-archives/
> 

I did not have the patience to go to all, that  link is so slooooow.
But it seems to me, at first glance, like a parsing bug in the shell(bash).

In Prashant example:
# source='There is no bug in BASH!' sh ./script echo `echo`script executed

It seems, ${source} was simply not set in the environmenti, after the
execution of  `echo`. 

A simple workaround would be not to use the shell parsing and rather
"env"  something like below should work

# env source='There is no bug in BASH!' sh ./script echo `echo`script executed

Now the burden is on "env" to parse for '=' and set the environment
before exec() the rest of the line.  So the shell will first
execute `echo` and past the expanded line to "env" to do the job.

Another would be to rewrite the line completly:
# source='There is no bug in BASH!'; export source; \
  sh ./script echo `echo`script executed

So the faulty parsing is bypass.

You may submit(merely a suggestion) a patch like this to Jim.

# where @ENV@ is expanded with a check
# to AC_PATH_PROGS(ENV, env) or something similar

ENV = @ENV@

all:
	$(ENV) source='$<' object='$@' libtool=no \
	....

But this look like it was generated by automake/libtool so
maybe those tools should cope with this strange behaviour of
the shell.

-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on n'est toujours assis que sur son cul !!!

- Raw text -


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