[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why does a Bash shell script write prompts followed by reads and do
From: |
Ángel González |
Subject: |
Re: Why does a Bash shell script write prompts followed by reads and do it right? |
Date: |
Wed, 02 Sep 2015 20:27:06 +0200 |
Robert Parker wrote:
> Yet when I attempt the same in a C program, the system always writes
> 2 prompts, then waits for a read.
> Does not matter if I write(1, "..."); read(0, number, buffer); or use
> fputs("...", stdout); fgets(.....
> The result is the same.
> And I have tried using readline without any better result.
I completely agree with Bob. It looks like your C program were doing a
loop (which your shell script doesn't!) and there's a wrong condition
somewhere.
But you need to show the code that is failing (provide a minimal
program that exhibits the failure).
- Re: Why does a Bash shell script write prompts followed by reads and do it right?,
Ángel González <=