Skip to main content

Difference between filename and . filename in macOS terminal [Resolved]

I'm newbie to MacOS. (I'm using mac OS high sierra 10.13.6) I installed a software. They said to initialize the software by

. /path/setsas.sh

I give no thought to . and space, so I just ran

path/setsas.sh

It seemed to run, but after that I couldn't execute any command of the software. I found that I should have ran the command as it were, and after that it was fine. So what these . and space mean here, and any guess why I couldn't execute any command at first even though file seemed to run? I know that . sometimes mean current folder, but it doesn't look like it in this case.


Question Credit: Septacle
Question Reference
Asked September 13, 2018
Posted Under: Apple
6 views
1 Answers

. /path/setsas.sh loads the variables and functions from the script into your current shell session. It's the same as running source /path/setsas.sh. Running path/setsas.sh on the other hand spawns a new process. The variables and functions will not be accessible from your current shell. That's why the commands weren't working for you.


credit: Jason Manuta
Answered September 13, 2018
Your Answer
D:\Adnan\Candoerz\CandoProject\vQA