很难准确地解释我正在寻找什么,所以我制作了一些示例输出,说明我希望我的终端如何工作。(行首的每个数字代表该行的返回值,> 代表输入行。
> me@computer:~$
5. me@computer:~$ cat somefile < command
start of file < output
< output
this < output
is < output
the < output
content < output
of < output
the < output
file < output
< output
end of file < output
4. me@computer:~$
3. me@computer:~$
2. me@computer:~$
1. me@computer:~$ echo this is the first line < command
this is the first line < output
Run Code Online (Sandbox Code Playgroud)
在此示例中,您键入要执行的命令的输入行将始终位于顶部。它会将每个命令和它的输出向下推送为“事件”,可以这么说。所以如果你 cat 一个文件,它会以相反的顺序输出所有内容,所以每个命令的输出外观没有改变,只是它的位置。