write to stdout with bundle marker, write err script on errors