“"的含义是什么.文件名" (时段空间文件名)在Bash中? [英] What is the meaning of ". filename" (period space filename) in Bash?

查看:119
本文介绍了“"的含义是什么.文件名" (时段空间文件名)在Bash中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

格式为[period] [space] [filename]的命令是什么意思?

What does a command with format [period][space][filename] mean?

示例:

. ./setup.sh

.bashrc文件中,也有这样一行:

Also in the .bashrc file, we have a line like that:

. "$HOME/.bashrc"

这是什么意思?

推荐答案

.运算符也称为source.

根据此论坛主题,第一个.是命令source,用于从作为参数给出的文件名中读取和执行命令. 第二个.是当前目录.

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

source setup.sh

如果当前目录./PATH环境变量中.

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.

这篇关于“"的含义是什么.文件名" (时段空间文件名)在Bash中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆