Unix/Linux Go Back    


UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

Redirecting several outputs to /dev/stdout

UNIX for Dummies Questions & Answers


Tags
force output to screen, multiple files, multiple outputs

 
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 03-06-2009
aplaydoc aplaydoc is offline
Registered User
 
Join Date: Feb 2009
Last Activity: 6 March 2009, 11:07 PM EST
Location: Montreal, Canada
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Redirecting several outputs to /dev/stdout

I have an executable that, depending on its input, outputs to either one file or several. It usually prints nothing on screen. The usual way to call this program is to specify an input and output filenames, like this:


Code:
./executable.exe -i inputfile -o outputfile

It will then try to use the output filename exactly if it needs to output to one file, or it will start appending -01, -02, -03, -04 etc... to the name and create as many outputs as needed otherwise. (These are not a combination of output and error files, they are all output files only)


I want to force output everything from it on screen. If I change my code to:


Code:
./executable.exe -i inputfile -o /dev/stdout

then it will only work if the program wants to create one output file. But I get the error


Code:
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::insert
Abort

in case it wants to output to several files. Is there another trick to force all outputs from it to print on screen??

Thanks
Sponsored Links
    #2  
Old Unix and Linux 03-06-2009
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 20 October 2017, 3:09 PM EDT
Location: Saskatchewan
Posts: 22,469
Thanks: 1,143
Thanked 4,262 Times in 3,936 Posts
Since it is the program that controls the opening and closing of its output files, no.
Sponsored Links
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Redirecting part of output to stdout Legend986 Shell Programming and Scripting 2 10-17-2008 03:20 PM
implicitly redirecting stdout to a file ALTRUNVRSOFLN Shell Programming and Scripting 1 09-23-2008 03:42 PM
Redirecting STDERR message to STDOUT & file at same time vikashtulsiyan Shell Programming and Scripting 10 04-09-2008 02:34 PM
redirecting STDOUT & STDERR jshinaman Shell Programming and Scripting 9 06-22-2007 12:04 AM
Printing outputs using awk. Krrishv Shell Programming and Scripting 4 01-09-2007 06:31 AM



All times are GMT -4. The time now is 10:29 PM.