awk {print $NF} output??

Hi,

I am trying to debug an old script and have found the problem lies within this function:

isIdoc() { # validate the file type
fileType=`file $1 | awk '{print $NF}'`
[ $fileType = "IDOC" ] && echo 0 || echo 1
}

My question is, how can I determine what is in the variable $fileType ? The program is failing only randomly, but I cannot modify the script (yet), so I need to know what value is being tested to "IDOC"... i'm not so sure what data is coming out of awk '{print $NF}'.

Thanks for any help...

FS

awk $NF prints only the last column in a record. If the file has only one row,
your variable will contain whatever is in the last column (space/tab delimiter).