Mail Archives: djgpp-workers/2000/04/10/16:45:44
>
> > What I think is happening is that the value of source is being lost after the
> > execution of the 1st process (that's `echo`). And since the script is invoked
> > next (the 2nd process to run), the "source" value is for some reason not
> > passed on which I think is a bug.
> >
Sorry, I did not follow the thread(no email for a while)
so I maybe out of line.
>
> Here are some curious items I came across:
> # source does not get set
> source='here is some text' echo $source
>
Normal behaviour, $source was expanded already
> # source does get set
> source='here is some text' ; echo $source
>
Normal behaviour source is set in the environment , but have you try these
# source='hello' ; sh -c 'echo $source'
# export source='hello' ; sh -c 'echo $source'
hello
different behaviours (note the export).
> # source does get set, and so does source2
> source='here is some text' source2='here is more more text'
> echo "$source"
> echo "$source2"
>
> It would seem that multiple variable assignments are ok, but a variable
> assignment followed by a non-variable assignment isn't.
Well that expected behaviour
# source='hello' echo $source
$source was already expanded, But If you try this
# cat echo_source
echo $source
# chmod +x echo_source
# source='hello' ./echo_source
hello
I do not know if this was helpfull, not seeing the original question
I shall go back to the shadow.
Note: the examples were done on my Solaris box with bash 2.02
--
au revoir, alain
----
Aussi haut que l'on soit assis, on n'est toujours assis que sur son cul !!!
- Raw text -