Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

what does source command do in linux

## 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: #source #command #linux
ADD COMMENT
Topic
Name
3+7 =