bug-coreutils
[Top][All Lists]
Advanced

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

Re: bugs in program "head" and maybe "tail"


From: Bob Proulx
Subject: Re: bugs in program "head" and maybe "tail"
Date: Mon, 17 Sep 2007 12:12:28 -0600
User-agent: Mutt/1.5.9i

Philip Rowlands wrote:
> Re-adding address@hidden so replies go in the list archives.
> On Fri, 14 Sep 2007, address@hidden wrote:
> >ok head is written for ascII file.
> >when i try open an other type file, my shell bugs.

Try using file pagers such as 'more', 'less', or 'most'.  A
recommended pager is the 'less' program.  Pagers and other file
browsers know about termainals and handle binary input in a reasonable
way.

  less ls.pdf

Additionally to view pdf files as text files the 'pdf2text' program is
very useful.  Also the less program may be configured to run the
pdf2text program automatically on *.pdf files and the result viewed in
a pager.  This is a very convenient combination.

> >when i tape ls after the command head (try my example), the display is 
> >not correct. I am to oblige to close Shell and to start again it to 
> >return to the normal one.
> 
> Yes, by writing binary (control) characters to the terminal, it may 
> become unreadable. There are measures you can take to fix this, 
> depending on the terminal; for example, the standard xterm has a "Do 
> Full Reset" command on the VT options menu. Other terminals or terminal 
> emulators may have similar, or if not then (on my computer) the "reset" 
> program from the ncurses package usually works.

In a standard xterm this is control-middle-button then select the menu
entry "Do Full Reset".  This will return the terminal to a usable
state.

This same issue exists with raw output of any binary file directly to
the terminal.  It would be the same with 'cat' too for example.  This
is not a problem with cat, head, tail, etc.  Effectively the terminal
has been instructed by the escape sequences in the file to take an
action or to change a configuration.  It is simply doing exactly what
it is being told to do.

Bob




reply via email to

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