On Sat, 23 Jun 2001, Alexander Skwar wrote:

>
> > [gc@obiwan ~] cat plop
> > [gc@obiwan ~] cat plop ; echo
> > 33018,ntUd5@dEDeBKtly{
>
> Ah!  So the prompt simply overwrites the output because the file isn't
> newline terminated?
>

What happens is that the shell outputs a carriage return before printing
the prompt. This is the default behaviour and it explains what you see.

zsh has a way around this though:

zsh$ echo -n ioqzejcoiqjzegf >meuh
zsh$ cat meuh                    # Nothing printed, the CR eats all chars
zsh$ unsetopt promptcr           # Magic!
zsh$ cat meuh
ioqzejcoiqjzegfzsh$

I don't know if bash can also do so, but I guess it can.

-- 
Francis Galiegue, [EMAIL PROTECTED] - Normand et fier de l'�tre
"Programming is a race between programmers, who try and make more and more
idiot-proof software, and universe, which produces more and more remarkable
idiots. Until now, universe leads the race"  -- R. Cook


Reply via email to