看apue遇到的一个问题

习惯就好zz
嵌入式领域新星创作者
2017-12-25 11:21:03
#include <termios.h>
#include "apue.h"

int isatty(int fd)
{
struct termios ts;

return(tcgetattr(fd, &ts) != -1); /* true if no error (is a tty) */
}

int main(void)
{
printf("fd 0: %s\n", isatty(0) ? "tty" : "not a tty");
printf("fd 1: %s\n", isatty(1) ? "tty" : "not a tty");
printf("fd 2: %s\n", isatty(2) ? "tty" : "not a tty");
exit(0);
}

程序编译出来是这样运行的
./a.out </etc/passwd 2>/dev/null

请问这个</etc/passwd是什么意思,这里并没有输入啊
...全文
377 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhxianbin 2017-12-25
  • 打赏
  • 举报
回复
重定向符号!

23,125

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧