Mail Archives: djgpp-workers/2002/02/14/02:44:49
On Wed, 2002-02-13 at 22:07, Mark E. wrote:
> > - readline not quite OK (Del, Ctl-Left, Ctl-Right, ... don't work)
>
> set TERM=djgpp
> should do it.
Ah OK - thanks.
> > - some issues with envvars:
> >
> > foo=bar echo $foo
> >
> > is supposed to print "bar", but doesn't.
>
> I seem to remember answering this once before. The answer is that this is the
> way Bash works:
>
> Simple Command Expansion
> ------------------------
>
> When a simple command is executed, the shell performs the following
> expansions, assignments, and redirections, from left to right.
>
> 1. The words that the parser has marked as variable assignments (those
> preceding the command name) and redirections are saved for later
> processing.
>
>
> In other words, "foo=bar" isn't peformed until after the command is executed.
Right.
Which explains why it works for
foo=bar ./shell-script
because everything in the script is simply a 'new command'.
So the problem is that a Perl script isn't run that way on DJGPP.
On Unices,
foo=bar ./perl-script
works fine (presumably, bash tries to process it as a shell script, sees
the #!, expands the envvar, and hands the script off to the system).
On DJGPP, bash runs the script without substituting the variable.
I'll see if the lack of ';' is deliberate (i.e. maybe "foo=bar;
./script" isn't portable); if not, I'll submit a patch to autoconf &
automake to use one.
- Raw text -