Re: [Cooker] Cannot cat file

2001-06-24 Thread Guillaume Cottenceau

Steve Fox <[EMAIL PROTECTED]> writes:

> On 23 Jun 2001 20:06:04 +0200, Guillaume Cottenceau wrote:
> > [gc@obiwan ~] printf 'plop'
> > [gc@obiwan ~] printf 'plop\n'
> > plop
> > [gc@obiwan ~] printf 'plop\n\n'
> > plop
> > 
> > [gc@obiwan ~]
> 
> I reported this too some time ago...seems like a bug to me (I would
> expect 'plop' w/o the line break), but no one else seems to.

It would not be logical, since what you type is copied back to the
console, you would end up with a blank line before each new prompt.



-- 
Guillaume Cottenceau - http://mandrakesoft.com/~gc/




Re: [Cooker] Cannot cat file

2001-06-23 Thread Steve Fox

On 23 Jun 2001 20:06:04 +0200, Guillaume Cottenceau wrote:
> [gc@obiwan ~] printf 'plop'
> [gc@obiwan ~] printf 'plop\n'
> plop
> [gc@obiwan ~] printf 'plop\n\n'
> plop
> 
> [gc@obiwan ~]

I reported this too some time ago...seems like a bug to me (I would
expect 'plop' w/o the line break), but no one else seems to.

-- 

Steve Fox
http://k-lug.org





Re: [Cooker] Cannot cat file

2001-06-23 Thread Guillaume Cottenceau

Alexander Skwar <[EMAIL PROTECTED]> writes:

> So sprach Guillaume Cottenceau am Sat, Jun 23, 2001 at 12:28:36AM +0200:
> > It's not newline terminated... so what?
> 
> Uhm, shouldn't cat display every file out there?  I thought that cat is also
> able to handle binary files with no problems, but I can see that this may
> break if this bug isn't fixed.

Uh... you're different...

Basically, 'cat' takes its STDIN and copies it to STDOUT.


> > [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?

Yeaaah! you got it!!! :-))

[gc@obiwan ~] printf 'plop'
[gc@obiwan ~] printf 'plop\n'
plop
[gc@obiwan ~] printf 'plop\n\n'
plop

[gc@obiwan ~]



-- 
Guillaume Cottenceau - http://mandrakesoft.com/~gc/




Re: [Cooker] Cannot cat file

2001-06-23 Thread Alexander Skwar

So sprach Andrej Borsenkow am Sat, Jun 23, 2001 at 01:08:13PM +0400:
> Not having final newline in tty text output is not common; and catting 
> binary files on tty is not the best way to see  contents.

yes and yes - but cat may also be used to "copy" files

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 0 hours 22 minutes




Re: [Cooker] Cannot cat file

2001-06-23 Thread Andrej Borsenkow

Geoffrey Lee wrote:

>>>a feature not a bug ..
>>>
>>Well, it depends if this is a "feature".  I'd call it a bug.
>>
>>
> 
> Set option nopromptcr to get this away. 
> 
> Try searching up the zsh docs / man page to get more info on this, the last
> time I read it I remember there was an explanation why this feature is in
> place ..
> 
> 



Ahh, that (I missed original message).


Yes, it is a feature. zsh must know the exact position on the screen, 
else output may be messed. promptcr makes sure the pscreen position is 
known.

The same sort of problem happens if prompt contains escapes that move 
cursor. You may be badly surprised.


Not having final newline in tty text output is not common; and catting 
binary files on tty is not the best way to see  contents.



-andrej





Re: [Cooker] Cannot cat file

2001-06-23 Thread Alexander Skwar

So sprach Francis Galiegue am Sat, Jun 23, 2001 at 07:33:31AM -0400:
> zsh has a way around this though:

Thanks!

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 hour 4 minutes




Re: [Cooker] Cannot cat file

2001-06-23 Thread Francis Galiegue

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





Re: [Cooker] Cannot cat file

2001-06-22 Thread Geoffrey Lee

> > a feature not a bug ..
> 
> Well, it depends if this is a "feature".  I'd call it a bug.
> 

Set option nopromptcr to get this away. 

Try searching up the zsh docs / man page to get more info on this, the last
time I read it I remember there was an explanation why this feature is in
place ..

-- 
Geoffrey Lee <[EMAIL PROTECTED]>
李長風

http://www.wychk.org/~glee

$ /usr/games/fortune
Anything that can go wrong will go
Segmentation fault (core dumped)
$ 





Re: [Cooker] Cannot cat file

2001-06-22 Thread Alexander Skwar

So sprach Geoffrey Lee am Sat, Jun 23, 2001 at 01:47:33PM +1000:
> Do you use zsh? There's an option (from Chmou) that forces zsh to do this, it's

Yes.

> a feature not a bug ..

Well, it depends if this is a "feature".  I'd call it a bug.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 0 hours 7 minutes




Re: [Cooker] Cannot cat file

2001-06-22 Thread Geoffrey Lee

On Fri, Jun 22, 2001 at 10:19:19PM +0200, Alexander Skwar wrote:
> 33018,ntUd5@dEDeBKtly{


Do you use zsh? There's an option (from Chmou) that forces zsh to do this, it's
a feature not a bug ..

-- 
Geoffrey Lee <[EMAIL PROTECTED]>
李長風

http://www.wychk.org/~glee

$ /usr/games/fortune
Anything that can go wrong will go
Segmentation fault (core dumped)
$ 





Re: [Cooker] Cannot cat file

2001-06-22 Thread Alexander Skwar

So sprach Guillaume Cottenceau am Sat, Jun 23, 2001 at 12:28:36AM +0200:
> It's not newline terminated... so what?

Uhm, shouldn't cat display every file out there?  I thought that cat is also
able to handle binary files with no problems, but I can see that this may
break if this bug isn't fixed.

> [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?

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 2 hours 22 minutes




Re: [Cooker] Cannot cat file

2001-06-22 Thread Guillaume Cottenceau

Alexander Skwar <[EMAIL PROTECTED]> writes:

> Hi!
> 
> For some strange reason, I cannot (even as root) 'cat' this file:
> 
> 33018,ntUd5@dEDeBKtly{
> 
> I also attached it.  When I cat it, it simply doesn't print anything?! 
> However, less is able to display the files contents.

It's not newline terminated... so what?

[gc@obiwan ~] cat plop 
[gc@obiwan ~] cat plop ; echo 
33018,ntUd5@dEDeBKtly{
[gc@obiwan ~]



-- 
Guillaume Cottenceau - http://mandrakesoft.com/~gc/




Re: [Cooker] Cannot cat file

2001-06-22 Thread Alexander Skwar

So sprach R.I.P. Deaddog am Sat, Jun 23, 2001 at 04:28:57AM +0800:
> I suspect you are hitting the same bug which appeared before when
> discussing bash problem. Try to terminate your file with newline instead,
> and you'll have some idea what happened.

Uhm, actually no - I don't have an idea what happened - BUT: this "fixed"
it.  Anyhow, this is not an acceptable solution wrt. cat.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 hour 31 minutes




Re: [Cooker] Cannot cat file

2001-06-22 Thread R.I.P. Deaddog

On Fri, 22 Jun 2001, Alexander Skwar wrote:

> For some strange reason, I cannot (even as root) 'cat' this file:
>
> 33018,ntUd5@dEDeBKtly{
>
> I also attached it.  When I cat it, it simply doesn't print anything?!
> However, less is able to display the files contents.

I suspect you are hitting the same bug which appeared before when
discussing bash problem. Try to terminate your file with newline instead,
and you'll have some idea what happened.

Abel





[Cooker] Cannot cat file

2001-06-22 Thread Alexander Skwar

Hi!

For some strange reason, I cannot (even as root) 'cat' this file:

33018,ntUd5@dEDeBKtly{

I also attached it.  When I cat it, it simply doesn't print anything?! 
However, less is able to display the files contents.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 0 hours 3 minutes


33018,ntUd5@dEDeBKtly{