You could keep using .export data if you get rid of the first two bytes in that format.
Get rid of those bytes using the cut command in unix, like this:
#################
# start unixscript
#################
mkfifo /tmp/mypipe.pipe
cat /tmp/mypipe.pipe|cut -b '5-999'|dd of=myfile.txt obs=32k &
bteq << EOF
.logon user,passwd;
.export data file=/tmp/mypipe.pipe,close;
select *
from table;
.export reset
.quit 0
EOF
#################
# end unixscript
#################