I have an init file that reads#!/bin/shexport PATH=$PATH:/home/me/morph_numsys/software/binby which I'd just like to set the path to that folder for only this bash session. However, when I execute the script, sh init, it still doesn't recognize the path. However, if I just say export PATH=$PATH:/home/me/morph_numsys/software/bin, then it works fine. Any ideas how I can do this?I'm on ubuntu and xterm.
temporary setting the path in an init file
ubuntu;xterm;path
When you say for only this bash session, I assume you mean the bash session that is calling the script.  When you execute your script, it gets a new shell environment.  Thus when you export variables, you are exporting it to the new shell environment and not its parent environment.  As far as I know, there is no way to access the parent environment.  However, since you are using bash, there may be a few solutions:Use sourceRather than execute the script like this: /path/to/init.sh do source /path/to/init.shFrom the bash man page:source filename [arguments]Read and execute commands from filename in the current shell environment and return the exit status of the last command executed from filename.Make your script a shell function and put it in .bashrcAnother option is to make init a function and put it in .bashrc like this:function init {    export PATH=$PATH:/home/me/morph_numsys/software/bin}Then from the terminal you can just run init.