HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

source — Execute commands from a file in the current shell. More information: <https://www.gnu.org/software/b

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandcommandsfromsourceexecuteclifile

Problem

How to use the source command: Execute commands from a file in the current shell. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-source>.

Solution

source — Execute commands from a file in the current shell. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-source>.

Evaluate contents of a given file:
source {{path/to/file}}


Evaluate contents of a given file (alternatively replacing source with .):
. {{path/to/file}}

Code Snippets

Evaluate contents of a given file

source {{path/to/file}}

Evaluate contents of a given file (alternatively replacing `source` with `.`)

. {{path/to/file}}

Context

tldr-pages: common/source

Revisions (0)

No revisions yet.