GNU readline: avoid prompt string in output if input is not interactive

Posted by Checkers on Stack Overflow See other posts from Stack Overflow or by Checkers
Published on 2010-03-09T05:15:24Z Indexed on 2010/03/09 5:21 UTC
Read the original article Hit count: 315

Filed under:
|
|

I have a readline-based application with a prompt, however I'd like it to not show when the input is not interactive.

$ ./readline-app < command-list > result
$ cat result
prompt> Output line 1
prompt> Output line 2
prompt>
$

How can I make the prompt to not print in this case?

© Stack Overflow or respective owner

Related posts about readline

Related posts about c