Shell – Run script in current shell without . before command

shell

If a script should be executed in the current shell, it can be achieved by adding a dot before the command:

   . ./somescript.sh

Is there a way to do this without typing the dot every time? For example a command to change to the parent shell from the script itself?

Best Answer

It may not be exactly what you want but you could do:

alias somescript.sh='. ./somescript.sh'
Related Question