Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

linux source command vs dot

## Defination -------------------------------------
# Source is a bash shell built-in command that executes the content of the file
# passed as argument, in the current shell. It has a synonym in `.` (period).



## Syntax -----------------------------------------
> source filename [arguments]
or 
> . filename [arguments]

## Additional Informaion ---------------------------
# Be careful! ./ and source are not quite the same.
> ./script # runs the script as an executable file, launching a new shell to run it
> source script # reads and executes commands from filename in the current shell environment
# Note: ./script is not . script, but . script == source script
 
PREVIOUS NEXT
Tagged: #linux #source #command #dot
ADD COMMENT
Topic
Name
6+1 =