On Wednesday 10 September 2003 00:12, Martin J. Brown wrote:
<snip>
> > Set the DISPLAY var within the script:
> >
> > DISPLAY=":0.0" gdialog --title "User Notice" --msgbox " WASHER IS \
> > FINISHED " 300 400
> >
> >
> > --
> > Andrew Gaffney
>
> Yes, that works. Thank you.
>
> Interestingly, if you put the DISPLAY part (DISPLAY=":0.0") on the line
> _before_ the 'gdialog' part. It doesn't work.
>
> Can you explain why it works, and why it doesn't when split?
>
> I thought I had figured it out, now, I'm not sure.
In a interactive shell, if you set an environment variable using the command
'DISPLAY=":0.0"' it creates the variable for the current environment only
and it will not be seen by subsequently executed commands. If you do
'export DISPLAY=":0.0"' the variable will be seen. Shell scripts work the
same way.
Putting 'DISPLAY=":0.0"' on the same line as the executable runs the command
in a modified environment based on the current one ('man env' gives more
details).
--
[EMAIL PROTECTED] mailing list