2

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
shx2
  • 61,779
  • 13
  • 130
  • 153

1 Answers1

3

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.

Community
  • 1
  • 1
cooltea
  • 1,113
  • 7
  • 16
  • I agree, this is a duplicate of that question. Annoying that you can't submit close votes for questions with bounty. – Barmar Mar 09 '13 at 11:25
  • Of course I already know there's no such existing special variable. Despite not getting a satisfactory answer to my question (I'm sure there is a way, it just might not be simple/pretty/conventional, e.g. you can always hack `tcsh`'s code, I was just hoping there's an easier way), I'm accepting your answer as you were the only one who took the time to write an answer ;) – shx2 Mar 15 '13 at 09:54