comp.unix.shell
  Home FAQ Contact Sign in
comp.unix.shell only
 
Advanced search
July 2008
motuwethfrsasuw
 123456 27
78910111213 28
14151617181920 29
21222324252627 30
28293031    31
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.unix.shell Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Why do I get an extra return in thie following case?         


Author: K-mart Cashier
Date: Jul 4, 2008 09:10

I just don't spend enough time "tinkering" with *nix. Anyhow when I
read from an unbuffered input and type something in, I get two prompts
after I hit return.

m-net%% more tty.c
#include

int main(void)
{
char c;

return(read(0, &c, 1) == 1) ? (unsigned char)c : EOF;

return 0;
}
m-net%% ./tty
c
m-net%%
m-net%%

Now when I buffer the input, and type something in, I only get one
prompt after I hit return.

m-net%% more tty2.c
#include
Show full article (0.75Kb)
1 Comment