问题
Is there any way to make tcsh keep the output of the last command in a special variable?
I know I can capture the output using backticks, but if I don't use backticks in the first place, it's not captured anywhere. (anyone who likes the underscore variable in the python shell knows what I'm talking about)
E.g.
% ls | head -2
% echo $_OUT_
-> myfile1 myfile2
回答1:
This page lists the special variables of tcsh and does not specify that there is a special variable for what you are looking for.
Also, here is a possible duplicate of your question.
来源:https://stackoverflow.com/questions/15056573/the-counterpart-of-python-shells-underscore-variable-in-tcsh