10,342 questions
Advice
0
votes
6
replies
127
views
Capture stderr while passing stdout to a pipe
My question is similar to How can I pipe stderr, and not stdout?
The following captures ALL the output from the cat command in a variable
_output="$(cat "$_filename" 2>&1)"
...
Score of -3
2 answers
101 views
Non-closing read from pipe, socket, or FIFO in terminal window or in shell
I don't know much about these things, but I understand that tools like nc and socat are used for reading from sockets/FIFOs. What I want to do is this:
I have socket/FIFO/whatever-the-appropriate-...
Score of -3
2 answers
121 views
Can pipe buffer limits be increased from inside a container? [closed]
In Linux, can a process inside a docker container increase a pipe buffer size beyond the maximum configured in the host OS?
I'm trying to write code to stream files between two different network ...
Score of -1
2 answers
130 views
How to detect *every* kind of error when printing to a pipe, including missing write permissions?
On this site and elsewhere, there are quite a few questions about how to handle errors when printing to a pipe in Perl. But none of the answers, solutions and explanations I have seen so far are ...
Score of 1
1 answer
117 views
In shell pipes, maintaing resilience against orphaned process and buggy applications
Further note: The inconsistencies have been identified as due to an interface change in the tool, less that breaks backward compatibility. Beginning with version 603, it is required to provide the ...
Score of 0
0 answers
52 views
Check if shell script/function is being piped into without false positives [duplicate]
I've searched around about how one can write a shell script (preferably cross-shell, but also in bash) that detects if it is being piped into so that it's operation can be changed accordingly. The ...
Score of 0
0 answers
85 views
Piping into interactive shell
I need to issue a lot of, say, wget commands manually. I figured the following would make it convenient:
$ sed 's/.*/wget &/g' | bash -i
Indeed, stdin is now listening to my input as I copy-paste ...
Score of 5
1 answer
174 views
How do I set redirected pipes to be non-buffered so I can use system() multiple times?
TLDR: I need to make unix pipes non-buffered so one subprocess can run multiple execs.
Hello, this is for a school assignment on UNIX pipes that I am having trouble with.
We are asked to make a 3 ...
Score of 3
5 answers
278 views
`printf` and `xargs` in a `for` loop
I want to produce this output:
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
For that I created this script:
(Based on https://stackoverflow.com/a/23961301/22133250)
...
Score of 1
1 answer
141 views
Bash command interpretation
I am creating a program that will simulate a pipe, for this i am checking the argument i have as input for this commands:
I am on Ubuntu, the shell is zsh.
I need to code this programm in C.
I have a ...
Score of -1
1 answer
118 views
How to correctly pass dynamically built command arguments to exec.Command in Go?
I am building a CLI tool for docker compose to selectively exclude some containers from running/stopping operations (from a docker-compose.yaml having many containers, user can specify the containers ...
Score of 3
1 answer
145 views
Java shell pipeline: `head` command doesn't output lines until it receives the expected number, even with `tail -f`
I'm building a shell in Java and currently implementing pipeline logic. For inter-process communication, I've created this class:
public class PipeConnector implements Runnable {
private final ...
Advice
0
votes
6
replies
105
views
Parsing pipes with boolean logic operators in bash
I'm investigating how Bash parsing works. Let's assume that all lower-case letters here represent scripts that always return a successful exit status - 0. The contents of all scripts are identical. ...
Score of 1
0 answers
245 views
Is it possible to set stdin of a process to a pipe and the rest to a TTY device?
I am trying to spawn a process so that I can do the following:
Send text to its standard input and specify EOF by closing the stdin pipe.
Connect the process' stdout and stderr to a TTY device so ...
Score of 0
1 answer
110 views
Named pipe is inaccessible while open from writer
I am trying to use the lauterbach application
The application has a built in command AREA.PIPE which pipes everything from the log window to a file
However, when I create a python script to read from ...