CREDIT GOES TO Dr. Greg Bethardy
Greg wrote a bash script that exports the column headers of a table as well as the data.
Here is a nicer example of a “wrapper”. Could still use some error checking and input validation. You can modify for your needs. You can copy it up and chmod to executable.
ncluster_export.sh <ASTER_USER> <ASTER_DB> <ASTER_PSWD> <TABLE> <FILE>
note: the <TABLE> must contain the schema