Fischer, Topher wrote: > Peter Henderson wrote: >> On Thu, Mar 31, 2011 at 6:07 PM, Topher Fischer <[email protected]> wrote: >>> Andrew McNabb wrote: >>>> On Thu, Mar 31, 2011 at 04:32:26PM -0700, Fischer, Topher wrote: >>>>> My co-worker just discovered a file on one of our boxes that contains >>>>> data, but when you cat it, it looks like it's empty. >>>>> >>>>> Any ideas on what's going on here? >>>> If it uses "\r" line endings (Mac style), it's possible that the >>>> terminal keeps on drawing over the same line. Could something like that >>>> be it? Do you have any more information about the data in the file? >>>> >>> The contents of the file seem to be unrelated. The contents are just >>> 'root', and I can see with hexdump that there are no other contents: >>> >>> 00000000 72 6f 6f 74 |root| >>> 00000004 >>> >>> SELinux is disabled. >>> >>> I can see the contents with vim, less, hexdump, etc. But I can't see >>> them with cat. I cannot see them if I do: >>> perl -e "print while <>;" filename >>> >>> >>> I'm baffled. >> How about: >> >> cat filename; echo >> >> If there's no trailing newline, your prompt might interfere >> with/overwrite the last line of the file. This command prints an extra >> line after running cat. Unix files are usually expected to end with \n >> but Windows files usually don't. (That's why diff says "No newline at >> end of file.") >> > Bingo! > > You, sir, get the donut. > > Disclaimer: Donuts are only redeemable at Top-Pot donut locations in the > Seattle downtown area. > --------------------
FYI: This problem does not happen with bash, sh, csh, tcsh, or ksh. zsh is the devil. --Topher -------------------- BYU Unix Users Group http://uug.byu.edu/ The opinions expressed in this message are the responsibility of their author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________ List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list
