Re: executing scripts
- From: John Taylor <john@xxxxxxxxxxx>
- Date: Wed, 28 Feb 2007 15:12:38 GMT
gpayne_onetel@xxxxxxxxxxx wrote:
HI,
Whats the difference in a scripts execution is I run it . ./scriptname
as opposed to ./scriptname.
What does the '.' do.
It 'sources' the script, so that all the commands are run in the current shell, as if you typed them.
I notice if I set variables and export them, there are only available
to use after script has executed with . ./script.
Why is this?
If you run without the dot, you are executing the script.
Another shell is run to execute the script. The variables are defined in the shell executing the command, and so you cant see them.
Regards
JohnT
.
- References:
- executing scripts
- From: gpayne_onetel
- executing scripts
- Prev by Date: executing scripts
- Next by Date: Re: a few queries
- Previous by thread: executing scripts
- Next by thread: Re: executing scripts
- Index(es):
Relevant Pages
|