I\'m missing something very elementary. Under Mac OS X. I\'ve tried chmod 0777 setdir.bsh. Must be something wrong with my settings.
#!/bin/bash
export makes the variable available to subprocesses, not parent processes.
export
Can you source this file instead ? e.g.
$ . setdir.bsh
That will execute the file in the current process i.e. the shell itself.