문제

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

Example:

. ./setup.sh

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

. "$HOME/.bashrc"

What does this mean?

도움이 되었습니까?

해결책

The . operator is also known as 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

is the same as

source ./setup.sh

or

source setup.sh

if the ./, the current directory, is in the PATH environment variable.

Here is the manual for that: http://ss64.com/bash/source.html

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top