Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top