using 'printf' in a script in terminal window

Jerry gesbbb at yahoo.com
Sat Nov 21 19:13:20 CET 2009


On Sat, 21 Nov 2009 11:26:09 -0600
Mike McNally <emmecinque at gmail.com> replied:


> On Sat, Nov 21, 2009 at 11:14 AM, Jerry <gesbbb at yahoo.com> wrote:
> > On Sat, 21 Nov 2009 13:32:48 +0100
> > Mike Massonnet <mmassonnet at gmail.com> replied:
> >
> >> I tested it on Terminal, Konsole, and finally xterm, none of those
> >> clear the screen. And if xterm isn't doing pretty much nobody does
> >> it.
> >>
> >> Why don't you use `clear'?
> >
> > This would appear to be a "by design" feature; although I cannot
> > fathom why. Using 'clear' is fine as long as the script is not used
> > via CRON. 'Clear' produces strange output with scripts run via
> > CRON. I know that there are ways to program around that; however,
> > it does complicate things. I prefer the "KISS" approach.
> >
> > Although it probably would not make any appreciable difference, I
> > might appeal to the developers to change this behavior.
> >
> There's no truly standard character sequence that clears a terminal
> display, and there never has been. The '\f' code is a "form feed",
> which is a printer control to feed out paper up to the next page
> perforation.
> 
> Most "terminal" programs (xterm et al) emulate old DEC VT-100
> terminals, which did not clear the screen in response to a form feed
> character, as far as I know.

I am not familiar with how it worked historically. I do know that there
is a very real difference between how the printf "\f" command works at
a console and how it works within Terminal, xterm, etc. If this was
Microsoft, I might expect the left hand to be ignorant of what the
right hand is doing. Here, I would expect better.

The bottom line is that this greatly inhibits my ability to fully test
scripts that I develop.

-- 
Jerry
gesbbb at yahoo.com

|::::=======
|::::=======
|===========
|===========
|

Democracy is a device that insures we shall be governed no better than
we deserve.

	George Bernard Shaw




More information about the Xfce mailing list