Questions tagged [stdio]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

*nix shell: How to disable pipe buffering for ALL pipes in a command?

I want every pipe to be unbuffered, so I don't have to type stdbuf -oL for every piped command. When concocting commands with multiple pipes, it would be nice if there was a environment variable or ...
user avatar
0 votes
2 answers
55 views

Unexpected expect/ssh question

I am seeking to automate ssh password based logins (and a series of actions after logging in). I am aware that the ssh password prompt bypasses STDIN. To that end I put together a quick expect script. ...
user avatar
  • 4,295
2 votes
1 answer
218 views

Additional file descriptor for debugging and piped output (logging, metrics, etc)

For a bash script project, I write human-readable log info to stdout/stderr. Additionally, I want to write formatted metrics to a third stream that will be discarded by default but can be redirected ...
user avatar
  • 23
2 votes
1 answer
100 views

Did fwrite/fread(3) offer different "multiple items" behavior on different platforms historically?

The fread(3) and fwrite(3) have an extra parameter for a variable number of items. So a typical write often has a hardcoded count when all it has is a char buffer to begin with e.g. fwrite(data, len, ...
user avatar
  • 184
1 vote
2 answers
60 views

How to read server stdout and continue only after message is outputted

Say I have a simple Node.js server like: const http = require('http'); const server = http.createServer((req,res) => res.end('foobar')) server.listen(3000, () => { console.log(JSON....
user avatar
1 vote
2 answers
621 views

Appending both stdout and stderr to file

I have this: nohup_ntrs(){ nohup_file="$HOME/teros/nohup/stdio.log" mkdir -p "$(dirname "$nohup_file")"; echo " ------------- BEGIN $(date) -------------- " >> "$nohup_file" nohup "$@" &...
user avatar
0 votes
0 answers
36 views

How to determine if a process is part of a pipeline (producer in pipeline)? [duplicate]

So if I am in my terminal and run: $ my_proc | grep foo in my_prof I know it's part of a pipeline because stdout is not attached to the terminal but to grep. On the other hand, if I just run this: $...
user avatar
1 vote
1 answer
71 views

Writing and Executing Program to behave like console

I have written a set of programs with the intent of using a radio transmitter-receiver (NRF24L01) to connect two devices as if they were connected via a serial interface. Currently, i am able to ...
user avatar
4 votes
1 answer
72 views

Determine if producer is outpacing consumer in pipeline

If I have: node foo.js | node bar.js is there a way to determine if there is a queue in between them that's building up? in other words if the producer is outpacing the consumer w.r.t. stdio?
user avatar
6 votes
3 answers
7k views

Behaviour of the backspace on terminal

This is about the behaviour of the backspace (\b) character.  I have the following C program: int main() { printf("Hello\b\b"); sleep(5); printf("h\n"); return 0; } The output on my ...
user avatar
7 votes
3 answers
4k views

Communicate backwards in a pipe

I have a simple pipeline: node foo.js | node bar.js bar.js will read from stdin to get data from foo.js. But what I want to do is ensure that bar.js gets one of the last messages from foo.js before ...
user avatar