Thank you to both Roger and Hakon for your suggestions.
Unfortunately, even under linux, an environment variable set in a shell
cannot be read from its parent process (in this case stata) and I cannot
find a way to get stata to read the return value. I don't know how hard
this would be to implement, but it would be useful if -shell- caused the
return value to be stored in, say, r(retval).
However, I have updated my stata and -file- works perfectly.
Thanks again, Chris.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/