[lug] How to redirect a program that writes to tty?

Stephen Queen svqueen at gmail.com
Sat Oct 30 12:06:47 MDT 2010


>   1. How can I achieve what I want, namely redirecting everything into my
> file
>   2. Why are they doing such a weird thing?
>
>
Off hand I can't answer question 1. I can show you a script that duplicates
the issue.

 #!/bin/bash


echo "test this is stderr" >&2
echo "test this is stdout" > /dev/tty

exit 0

/dev/tty is the current controlling terminal. I could possibly see a number
of reasons to send output their rather than stdout. One would be to ensure
that the output goes to whatever terminal started the module.

Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20101030/0b5ff8c7/attachment.html>


More information about the LUG mailing list