in reply to Determine whether file is dos or unix format

While it appears your question has been adequately answered, I would still like to direct your attention to flip: Newline conversion between Unix, Macintosh and MS-DOS ASCII files, which not only converts between DOS and Unix file formats, but also includes a handy -t command-line switch to tell you which format a given file uses. I use it a lot.

HTH,

planetscape