Fake output stream type
Posted
by Jeenu
on Stack Overflow
See other posts from Stack Overflow
or by Jeenu
Published on 2010-05-20T06:28:49Z
Indexed on
2010/05/20
6:30 UTC
Read the original article
Hit count: 140
stream
By default certain programs format their output according to the type of the stream they write to. For example, the output of ls
and ls > file
looks differently. I'd like to know how this is achieved by a program. Additionally, is there a way by which we can trick such programs as if the output stream is a terminal where it actually is a file (especially when they don't have any options that affect output formatting)?
© Stack Overflow or respective owner