|
原帖由 sqysl 于 2008-6-16 07:09 发表 ![]()
哦,以前记得看到过你说的这些,不过,一直没弄明白,这次趁这次机会,请YONG HUANG一定帮我讲清楚点,好吗?先谢谢了,./test.sh和. ./test.sh的具体区别及内在原理,最好能讲深入点,非常感谢。
It's UNIX (Linux) shell. A dot script runs in and affects the current environment, while a regular script (run without a dot) runs in its own shell. A dot script is a ksh/sh/bash concept and is equivalent to running a csh/tcsh script with the source command.
As to why running "sqlplus user/pass @SQLscript" in a subshell automatically commits, I'm not sure. It behaves like the subshell typed "exit" or ^D before it exits itself. That is, it seems to have done "exit" twice, once for the sqlplus command, and once for the subshell itself. Maybe that's what a subshell normally does? Check a UNIX shell programming book. When I have time, I'll check too.
Yong Huang |
|