On Tuesday 05 December 2006 18:01, Greg Wallace wrote:
> MYVAR=xyz
> export MYVAR
>
> After the script runs, I do an echo MYVAR and it comes up empty.
hi Greg,
Please allow me to add a couple of tips to what Jorge has already told
you,
just for clarification.
The export keyword works *forward*--- in other words, if you want MYVAR
to be
in scope for subsequent scripts then the variable needs to be exported. The
export does not work in reverse.
The dot command is subtle and has some side effects that you might want
to
keep in mind.
First, as Jorge pointed out, the dot command says use the existing
interactive shell instead of a new shell. This may not be what you really
want, since it *ties up* the interactive shell until the script or
executeable returns.
Second, the dot command can be used to run (execute) a script that does
not
technically have execute permissions... because the dot command does not take
into account whether the source file is executeable or not... it just feeds
the lines of the source file line by line to the interactive shell to
interpret.
--
Kind regards,
M Harris <><
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]