How to source files on the Linux command line

preview_player
Показать описание
In this Linux tip, we’ll look at how you can “source” files on the Linux command line. “Sourcing” means reading the file and running the commands that it contains – even if the file isn’t set up with execute permissions. There are two ways to do this. One involves using the source command as in the command “source myfile”. The second way is to replace the word “source” with a dot as in “. myfile”. The results will be the same.

------------------------------­----
Рекомендации по теме
Комментарии
Автор

One difference between sourcing and just running a script is that running the script spawns a child process, which dies when the script ends, taking with it all of your changes of directory and non-exported variable definitions and shell functions, while sourcing keeps them.

LaMirah
visit shbcf.ru