Is there a way to mark a script to be executed in the current shell from whitin It? I know I can use:
. ./path/myscript.sh
but I need a way to include the "dot" way inside the script.
Edit: Here is the case. I have a script "myscript.sh" located in directory A:
rm -r A
mkdir A
touch A/test.file
cd A
When the script is executed in normal a way:
sh myscript.sh
When exiting the script I cannot list the directory. When script is started in the current shell:
. ./myscript.sh
There is no problem. I need a way to include this "dot" way inside my script so It can be called without It.