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.
我编写了一个p1.c从 linux 命令 shell ( ) 获取输入的程序Using- char n=argv[1]。我希望将 的字符输出p1.c作为程序的输入p2.c。我怎样才能做到这一点?我使用了命令 ./p2.out < ./p1.out T > output.txt。它似乎不起作用,因为 'T' 被用作输入p2.out并且它的输出被写入output.txt.
p1.c
Using- char n=argv[1]
p2.c
./p2.out < ./p1.out T > output.txt
p2.out
output.txt
使用管道:./p1.out T | ./p2.out
./p1.out T | ./p2.out