All Questions
Tagged with named-pipes bash
99
questions
1
vote
0
answers
48
views
Bash − Using one bc instance in a named pipe [duplicate]
Context: I have a script which makes multiple calls to bc to set some values, ie: many foo="$(echo '1/3' | /usr/bin/bc -q)"
What I want to achieve: do not call bc every times, but keep one ...
5
votes
0
answers
76
views
Random 141 Signals when working with fifos / named pipes
The way I understand fifos, the open of a reader or writer blocks until the other side opens as well, a read blocks until somebody writes, and any side closes when the last one of the other side ...
0
votes
0
answers
63
views
Bash: identifying which command printed which output
I want to write a program that works as follow:
The user runs my program, and I, on behalf of the user, run a bash process (for example, through ssh)
Everything the user enters, is sent to the stdin ...
1
vote
0
answers
252
views
How to write my TCPDump data from a pipeline in Linux to a pcap file?
So I am writing a program on a PLC where I need to constantly record network traffic with TCPdump into a Linux Pipeline. Every x minutes I need to write the data from the pipeline into a pcap file ...
0
votes
2
answers
1k
views
Is it possible to redirect a named pipe to standard output using only shell redirection?
I need to write a shell script, the output of which is fed to the standard input of another application. The shell script needs to read data from a named pipe pipe.fifo.
A trivial way to do this is ...
1
vote
1
answer
45
views
why does readline think I am pressing the "d" key?
I have two scripts. test4.sh calls 1.sh
I don’t understand why 1.sh things I am pressing the “d” key. Can you explain please
Here is 1.sh
set -x
echo "Please enter some input: "
echo "...
0
votes
1
answer
455
views
Shell script : Want to show a few details in stdout & All details in log file
Say, this is my shell script
echo "Show this on stdout and logfile"
wget -O ....... # "Only in logfile"
echo "Show this on stdout and logfile"
cp file1.txt # "...
5
votes
1
answer
2k
views
What are the differences between fish shell and bash when handling named pipes?
When executing these command in fish shell
$ mkfifo answer
$ nc -vv -l -k -p 8001 <answer | tee -a answer
The command hangs.
If I write to answer through echo "" > answer. Then the nc ...
1
vote
1
answer
144
views
Different behavior with echo vs echo|cat when reading to / writing from FIFOs (pipes)
I'm trying to understand the reason why echo behaves differently than echo "Hi"|cat when used in a bash script, with broken pipe
Behaviour :
echo immediately terminates the script
echo &...
0
votes
1
answer
79
views
Named pipe swallowing first field of Linux command output
I'm trying to parse the output of the Linux df tool for use in a machine status report. I'm using almost identical code to parse the output of the ps tool and it works fine (all fields are available ...
1
vote
1
answer
535
views
Read from n pipes from one process in parallel
I faced a concurrency problem when writing to the same named pipe created with mkfifo by multiple processes at the same time, where some writes got lost. Since the number of writing processes are ...
2
votes
2
answers
419
views
bidirectional pipe with children process
I would like to run a child process that can read and write data from/to the parent process, in a way that the child process uses standard stdin/stdout, and doesn't use named pipes.
I wrote simple ...
0
votes
2
answers
493
views
Intercepting fifo
I have two named pipes which are used for communication between an app and a service.
Basically the App is a GUI that takes input from the user and writes data to named pip lets call it out_fifo. The ...
2
votes
1
answer
88
views
How to get multiple strings from pointer that stores the output of a shell script in C?
I am trying to write a code in C with named pipes (fifo), where the client is asking for information about a directory.
The server checks for the existence of the directory, and sends back the size ...
1
vote
1
answer
219
views
Is it possible to prevent application from hanging when both stdin and stdout are connected to named pipes?
Consider the following simple C program, which I will compile to a program called "A":
#include <stdio.h>
int main(int argc, char** argv){
putchar('C');
putchar('\n');
}
Now, consider the ...