点空间([点] [空格] [文件名]) [英] Dot space ( [dot][space][filename] )
问题描述
什么用格式[点]命令[空格] [文件名]是指?
What does a command with format [dot][space][filename] means?
示例
. ./setup.sh
此外,在.bashrc文件中,我们有一个这样的行
Also in .bashrc file we have a line like that
. "$HOME/.bashrc"
这是什么意思?
What does this mean?
推荐答案
。操作者也被称为源
据<一个href=\"http://www.unix.com/shell-programming-scripting/177636-dot-operator-space-parameter-not-set.html\">this论坛主题,第一次'。是命令源读取和指定的参数文件名执行命令。
第二 '。'是当前目录。
According to this forum thread, the first '.' is the command 'source' to read and execute commands from the filename given as argument. The second '.' is the current directory.
. ./setup.sh
是相同的
source ./setup.sh
或源setup.sh
(如果./,当前目录,在PATH环境变量)。
or
source setup.sh
(if the ./, the current directory, is in the PATH environment variable).
下面是用于手动
http://ss64.com/bash/source.html
这是通常用于运行在当前shell脚本来帮助建立执行环境,以及设置别名。
This is typically used to run the script in the current shell to help set up the environment for execution, as well as to set up aliases.
这篇关于点空间([点] [空格] [文件名])的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!