We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e87f169 commit ef458baCopy full SHA for ef458ba
docs/Ch06/index.md
@@ -366,7 +366,7 @@ drwxr-xr-x 2 ustc ustc 4096 11月 17 20:45 模板/
366
367
!!! tip "关于 `.` 命令"
368
369
- 与直接执行脚本,或者指定 shell 执行脚本不同,使用 `.` 命令执行脚本会在当前 shell 中执行脚本,而不是新建一个 shell 去执行脚本。这意味着,脚本中的变量定义、函数定义等都会在当前 shell 中生效。
+ 与直接执行脚本,或者指定 shell 执行脚本不同,使用 `.` 命令执行脚本会在当前 shell 中执行脚本,而不是新建一个 shell 去执行脚本。这意味着,脚本中的变量赋值、函数定义以及切换目录(`cd` 命令)等变化都会在当前 shell 中生效。
370
371
在 bash 中,`source` 命令与 `.` 命令等价。有些情况下,使用 `.` 执行脚本是有必要的,例如在激活 Python 的虚拟环境时:
372
0 commit comments