What is the difference between source <script>
and ./<script>
?
相关问题
- How to get the return code of a shell script in lu
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Invoking Mirth Connect CLI with Powershell script
- Error building gcc 4.8.3 from source: libstdc++.so
source script.sh
runs the script within the current process, thus all variable assignments are preserved as variables even after the script finishes (and don't have to be explicitlyexport
'd)../script.sh
just runs the script in a subprocess, and any variables which are assigned disappear after the script is done.source script will change your current environment, ./script will not.
(EDIT: script has to be executable to use ./)