C输入输出重定向错误?

C input and output redirection error?

我现在在处理我的文件时遇到了这条奇怪的消息。 我有一个非常基本的 C 文件,它从文件中读取并根据要求输出。 我是 运行 Linux 中的以下命令:

filename <filenametest.txt >filenameoutput

并带来以下信息:

filename: command not found

知道为什么它不起作用吗? 真令人沮丧。

假设 filename 是编译 C 代码时生成的可执行文件的名称,也许您应该尝试使用

./filename < filename.txt > filenameoutput

因为默认情况下 filename 不在搜索路径中。