问个入门问题
时间:2011-07-24
来源:互联网
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
其中. ~/.bash_aliases的第1个小数点是什么意思
作者: anth 发布时间: 2011-07-24
作者: dreamcast_sh 发布时间: 2011-07-24
作者: levee 发布时间: 2011-07-24
谢谢
作者: anth 发布时间: 2011-07-24
The commands in the specified file are read and executed by the shell.
man bash
source filename [arguments]
Read and execute commands from filename in the current shell environ‐
ment and return the exit status of the last command executed from
filename. If filename does not contain a slash, file names in PATH
are used to find the directory containing filename. The file
searched for in PATH need not be executable. When bash is not in
posix mode, the current directory is searched if no file is found in
PATH. If the sourcepath option to the shopt builtin command is
turned off, the PATH is not searched. If any arguments are supplied,
they become the positional parameters when filename is executed.
Otherwise the positional parameters are unchanged. The return status
is the status of the last command exited within the script (0 if no
commands are executed), and false if filename is not found or cannot
be read.
man zshbuiltins
Read commands from file and execute them in the current shell envi‐
ronment.
If file does not contain a slash, or if PATH_DIRS is set, the shell
looks in the components of $path to find the directory containing
file. Files in the current directory are not read unless `.' appears
somewhere in $path. If a file named `file.zwc' is found, is newer
than file, and is the compiled form (created with the zcompile
builtin) of file, then commands are read from that file instead of
file.
If any arguments arg are given, they become the positional parame‐
ters; the old positional parameters are restored when the file is
done executing. The exit status is the exit status of the last com‐
mand executed.
作者: ChenFengyuan 发布时间: 2011-07-24
所以一般牵扯到变量共享的
贴别是调用设置变量参数的自脚本
必须前头带点
作者: jarlyyn 发布时间: 2011-07-24
方法一: 重启shell
方法二: 重启系统
方法三: $ . ./xxx.sh 或者 $ source ./xxx.sh
. 与 source 等价.

作者: taiandotzhang 发布时间: 2011-07-24
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28