I know the above topic has been discussed before
sourcea .sh file and you retain the environmental variables after you are done with the sh file- while
./a .sh file and you lose the environmental variables after you are done
However, I have the following script, makefile.sh
#!/bin/sh
echo $(pwd)
export PATH=$PATH:$PWD
## source the environment
source environment-setup
When I source the above file, it went through successfully even without exporting PATH. However when I use ./ of the above file, it gives me ./makefile.sh: 7: ./makefile.sh: source: not found.
I have placed environment-setup in the same directory as the makefile.sh. Do we need to do something more? Or am I missing out some subtle differences between source and `./
Regards