How to redirect output away from /dev/null
        Posted  
        
            by Gowtham
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Gowtham
        
        
        
        Published on 2010-03-24T12:28:27Z
        Indexed on 
            2010/03/24
            12:33 UTC
        
        
        Read the original article
        Hit count: 383
        
I have an application that runs the a command as below:
<command> >& /dev/null
I have no control on this. All the o/p generated by this command goes to /dev/null. I want the output to be visible on screen or redirected to a log file.
I tried to use freopen() and related functions to reopen /dev/null to another file, but could not get it working. 
Do you have any other ideas? Is this possible at all?
Thanks for your time.
PS: I am working on Linux.
-Gowtham
© Stack Overflow or respective owner