Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有提示的基于 readline 的应用程序,但是我希望它在输入非交互式时不显示。
$ ./readline-app < command-list > result $ cat result prompt> Output line 1 prompt> Output line 2 prompt> $
在这种情况下如何提示不打印?
用于isatty(3)确定标准输入和/或标准输出是否连接到 tty。
isatty(3)