我能否抓住我最后几任指挥官的产出? 注:
I often run a slow and verbose command from tcsh, forget to redirect/tee the output, and have the results scroll off the screen. Solutions I ve considered:
Run everything inside script . This seems like overkill, since it saves the output of everything, not just the last few commands. I suppose you could cleverly rotate script output files somehow, but this seems ugly.
Screen/rxvt/xterm scrollback. This actually works fairly well, unless the output is voluminous (which it often is).
Run the command again. Obviously, this is what I m hoping to avoid (though, thanks to filesystem caching, the rerun is often quicker than the first run).
要求停止这种大坝。 没有任何希望。
EDIT: One thought: can I make tcsh run a "post command" on everything I type in? For example, if I say "ls", it secretly runs "ls | tee /tmp/lastout.txt" or something? Is there some setenv variable that does this?