I have a utility
foo that I want to grep output from, redirect, and otherwise do all the normal text manipulation stuff. But alas! Look at what it does...
$ foo bar $ foo > /dev/null bar $ foo 2> /dev/null bar $ foo | grep abc bar $ foo 2| grep abc bar
Apparently the output is neither
foo rights directly to the tty instead of to stdout. There is an answer here that provides a workaround using
script -c. But alas again!
$ script -c foo > /dev/null script: illegal option -- c usage: script [-a] [file]
script utility is not the full version. The operating system is QNX.
For those of us who cannot use the
script -c workaround, how can we easily capture the output? Is there a way to redirect the tty file itself, if that makes any sense?
Is it possible to do something like
foo (/dev/ttyp0)| grep abc? That likely will not work exactly as shown, but is there a way to do something similar? An answer which requires the file to be redirected first (if that is even possible) is fine, so something like
/dev/ttyp0 please go to /dev/null ; foo is ok.
Ultimately, I would like to be able to pipe the output of
grep and/or redirect
foo output to a file.