bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug maybe found in cat


From: Paul Jarc
Subject: Re: Bug maybe found in cat
Date: Fri, 22 Aug 2003 15:52:45 -0400
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Nicolas Bonifas <address@hidden> wrote:
> Hello, I think I've found a bug in cat: when I type 'cat true' (when
> I'm in the directory of the 'true' binary, /bin/ on my computer), my
> terminal becomes unreadable (normal characters are printed as
> control characters).

It's not a bug.  cat is doing what you tell it to do: it prints the
contents of the "true" file.  Binary files typically contain certain
character sequences, purely by chance, that tell the terminal to do
strange things.  The terminal has this capability because occasionally
it is genuinely useful, but the terminal cannot distinguish between
cases where the special characters were intended to change the
terminal's behavior and cases where they were only meant to be
printed.  You may be able to fix the terminal with the "reset"
command.  To keep it from happening, simply don't print random binary
data to your terminal.  You can safely view it using a pager like
"less", though, with the appropriate options.


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]