On Fri, Sep 23, 2011 at 5:02 PM, Philipp Thomas
On Thu, 22 Sep 2011 21:13:16 +0800, George Olson
wrote: Ah, ok, let me see if I comprehend this correctly. So the first example won't create a child process
Nearly right :) The shell always creates a new process, be it for binary programs or an interpreter for a script (a shell, sed, awk, perl etc.). As others wrote, '.' means "let the current shell run the given script".
To be pedantic the above is either a little strong or unclear (I'm not sure which). Suppose I have a "file" (not a script) that has content: ### TEST_DEV=/dev/sda3 echo $TEST_DEV ### If I source that (. filename) it will not create a new process. The shell itself is able to process those commands. (It has a built-in echo command.) If I execute the above (./filename or just plain filename) then a new shell child process is invoked to run the commands. If I modify the file to say: ### TEST_DEV=/dev/sda3 /bin/echo $TEST_DEV echo $TEST_DEV ### Then when I source the file, a child process (/bin/echo) is launched, but only for that one command, the first and last are still processed by the original shell. And if I execute the file I get both a child shell process and a grandchild /bin/echo process. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org