Link to home
Start Free TrialLog in
Avatar of rsshetty
rsshetty

asked on

Redirect program related command output to file

I want to run a program and be able to redirect memory usage of the program into a file. eg. timex someprogram >> somefile
However, when I do that, the output of the program goes into the file not the output of timex.
Also, I need a command to capture memory usage.

rsshetty
Avatar of yuzh
yuzh

You need to redirect the stdin to file to get the out put of someprogram, eg:

timex someprogram 1>>somefile

or :
to get output of timex:
timex someprogram 2>>somefile
To save out of timex and someprogram to seperate files you do:

timex someprogram 1>>prgoutput  2>>timexoutput
Avatar of rsshetty

ASKER

I did what yuzh wrote but it gives me an error saying Ambiguous output redirect.
ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial