>I have a simple question about command syntax in the Korn or Bourne shells.
>Specifically, about the differences between the following commands:
./myscript tries to run the executable myscript in the current directory
(./). If this is a shell script, or if the shell thinks that it is, then
it will be run in a new shell, so any new variables set will only be for
that shell invocation.
Quote:>Does the . <space> syntax (as seen in the second command) imply an implicit
>export for all variables declared or changed within the subshell that runs
Does the equivalent of source in tcsh (some shells search through PATH to
find the file), ie it is run in the current shell.
From the ksh man page:
. file [argument ...]1
Reads the complete file and executes the commands. The commands are
executed in the current shell environment. The search path specified by
PATH is used to find the directory containing file. If any arguments
are specified, they become the positional parameters. Otherwise, the
positional parameters are unchanged. The exit status is the exit status
of the last command executed.
Quote:>I am more used to using tcsh, so I usually just use "source ./myscript" but
>this does not appear to be valid in the ksh or bsh.
source isn't a command in ksh, but it should be in bash.