I want to write the log from a script (the verbose stream) into a sharepoint list item attachment. I believe I have the resources (tutorials and script fragments) to write a file to disk, then read it ...

I have a main c++ program. This program at its startup launches another process executable using CreateProcess() function. Now I want to redirect the standard output (stdout) of this new process to ...

I have an executable of a program, written in Fortran that needs interactive input, for example 20 inputs. What I want, is to give the first 19 inputs through input redirection but the last one from ...

I would like to redirect both stdout and stderr to file1, but also redirect only stderr to file2. Is this possible? I have a working script for part 1, but can't figure out how to additionally write ...

I'm trying to pipe a string into a C# program's STDIN without any trailing newlines (unless that string itself actually ends in a newline). I tried googling around, but I only found people trying to ...

I'm trying to change my grades in a text file, and then direct the output to a new text file using the >> operator instead of overwriting the old file.
But, the text file has a significant amount of ...

I am wondering if anyone could point me in the right direction on how to do this? For example, if I write "ls > contents.txt", I want the output of ls to be written into content.txt.
This is what I ...

If I do a git clone from a terminal, I get something like this progress report:
$ git clone https://github.com/defunkt/github-gem.git repo2.git
Cloning into 'repo2.git'...
remote: Counting objects: ...

I have a python script that uses multiprocessing.pool.map to do some work. As it goes it prints things to stdout, for errors it prints to stderr. I decided it would be nice to have a separate log file ...

After the question In a shell script: echo shell commands as they are executed I wonder how can I redirect the command executed/echoed to a file (or a variable)?
I tried the usual stdout redirection, ...

I want to open a TCP socket in bash, using the /dev/tcp/host/port psuedo-device syntax, but I need to recover gracefully if the host/port endpoint is not listening. This is easy if all I'm doing is ...

I have very big text files(~50,000) over which i have to do some text processing. Basically run multiple grep commands.
When i run it manually it returns in an instant , but when i do the same in a ...

I have a script using for a building a program that I redirect to sed to highlight errors and such during the build.
This works great, but the problem is at the end of this build script it starts an ...

Some console applications, such a plink, may not print a new line character after printing important information (eg. "Store key in cache? (y/n)"). Is there a built in way to asynchronously read from ...

Below is a solution I found from:
Create a pipe that writes to multiple files (tee)
Hence the code below redirects stdout and stderr to the logfile whilst displaying them in the terminal as well. I ...

I am using code like the following to redirect stdout before calling a noisy function from an external library written in Fortran:
// copy standard output
out = dup(STDOUT_FILENO);
// close standard ...