0

For the most part, many bash commands work the same either way but some don't. I'm confused on what exactly the difference is. To clarify, it's the difference between:

./file.sh

and

. ./file.sh
Areisner
  • 85
  • 4
  • 6
    The first one executes a file. The latter sources a file. The difference is that the latter affects your current environment. The former executes in a sub-shell. The latter executes in the current shell. – alvits Aug 12 '20 at 05:18
  • `help .` and `help source` should give you the same info/output. – Jetchisel Aug 12 '20 at 05:25
  • Not all executables can be sourced like a script without causing issues, but all of them can be executed as a file provided the proper permissions and "deep" internal setup to identify and run executables based on their magic value. – l3l_aze Aug 14 '20 at 06:19

0 Answers0