translate shell script wrapper into C++ code, for portability