Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In linux, what does the built-in command source do?
Answer

It executes a shell script IN THE CURRENT SHELL, therefore preseving the variables/environment variables set by that script in the current/originating shell.

e.g. if you do "source test.sh" and test.sh sets variable X=2, then in the originating/current shell, X is now set, even after test.sh finishes running.


Question
In linux, what does the built-in command source do?
Answer
?

Question
In linux, what does the built-in command source do?
Answer

It executes a shell script IN THE CURRENT SHELL, therefore preseving the variables/environment variables set by that script in the current/originating shell.

e.g. if you do "source test.sh" and test.sh sets variable X=2, then in the originating/current shell, X is now set, even after test.sh finishes running.

If you want to change selection, open document below and click on "Move attachment"

20. Advanced Shell Scripting
rking directory. set Prints the value of all environment variables. See also Section 20.6 on the set command. source filename args ... Reads filename into the current current shell environment. <span>This is useful for executing a shell script when environment variables set by that script must be preserved. times Prints the accumulated user and system times for the shell and for processes run from the shell. type command Tells whether command is an alias, a built-in or a system executable.

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.