Question: I have a windows batch script where I use SETLOCAL to set path variables for that session only. Is there a Mac equivalent for that command scripts?

Answer: 
The Unix/Mac equivalent would be the export command:

```
export FOO=1

```

<http://www.cyberciti.biz/faq/linux-unix-shell-export-command/>
In Unix shells (such as with bash or sh on Mac OS X), all variables set in a shell script do not survive the end of the shell script. This means that SETLOCAL is already the standard behaviour. In fact the non-SETLOCAL behaviour is not possible from the script itself (but the launcher of the shell can still order the shell to run the script in the current shell with the 'source' command to have that behaviour).

For the variable to be visible to programs launched from that session, you have to *export* the variable:

```
export BAR=1

```