Questions tagged [mkfifo]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
146 views

Adding 'Progress bar / counter' to a parallelised For Loop

I've been greatly inspired by this question: Parallelize a Bash FOR Loop to parallelise some tools I've written that involve very loooong while read loops (ie doing the same task / set of tasks ...
user avatar
0 votes
1 answer
100 views

How to guarantee that that only a specific process reads from a named pipe?

Suppose that, at time (1), I create a named pipe using Python with the goal that eventually this Python process would write something to that named pipe. Why? Because, at time (2), there is another ...
user avatar
  • 143
3 votes
0 answers
311 views

How to pipe all output streams to another process?

Take the following Bash script 3-output-writer.sh: echo A >&1 echo B >&2 echo C >&3 Of course when ran as . 3-output-writer.sh it gets the error 3: Bad file descriptor, because ...
user avatar
2 votes
2 answers
43 views

Process in Pipe which Processes 256 bytes at a Time

I have a c program on a Cyclone 5 that does an FFT using the connected FPGA. This program currently takes 256 bytes from stdin and then process it gives the FFT results on stdout. I run it like this ...
user avatar
2 votes
1 answer
116 views

Using tee and paste results in a deadlock

I am trying to redirect stdout of a command into two "branches" using tee for separate processing. Finally I need to merge results of both "branches" using paste. I came up with the following code for ...
user avatar
0 votes
1 answer
46 views

Why don't named pipes respect the order at which readers were attached?

I have this test script: #!/usr/bin/env bash fif="foooz"; rm "$fif" ; mkfifo "$fif" ( cat "$fif" | cat && echo "1") & sleep 0.1 ( cat "$fif" | cat && echo "2") & sleep 0....
user avatar
2 votes
2 answers
1k views

How to write something to named pipe even if there are no readers

I have this little test script: rm fooo | cat mkfifo fooo echo 'bar' > fooo # blocks here echo 'done' I am guessing that because there is nobody reading from the named pipe, that the write call ...
user avatar
3 votes
1 answer
2k views

How to check for presence of named pipe on the file system [duplicate]

I tried using the -f flag to test if a named pipe is present if [[ ! -f "$fifo" ]]; then echo 'There should be a fifo.lock file in the dir.' > /dev/stderr return 0; fi this check does not ...
user avatar
0 votes
1 answer
124 views

Run program when/instead of writing to FIFO? [closed]

I have a program that writes data every second to a FIFO. Now I want to alter some of this data and write it to another FIFO. What would be the best approach? Can I somehow pipe this directly to my ...
user avatar
  • 99
6 votes
1 answer
1k views

Why doesn't mkfifo with a mode of 1755 grant read permissions and sticky bit to the user?

I'm creating a server and client situation where i want to create a pipe so they can communicate. I created the pipe in the server code with mkfifo("fifo",1755);: 1 for only user that created and ...
user avatar
1 vote
1 answer
481 views

mkfifo to copy / move files

Is it possible to use mkfifo (named pipes) in Linux to copy files? For example: I am extracting files from tar archive and I want them to be moved immediately to another location.
user avatar
1 vote
2 answers
85 views

Two named PIPEs (PIPE_in/PIPE_out) connected with `tail -f` | String sent to PIPE_in doesn't reach PIPE_out

1.Create named PIPEs, pipe_in and pipe_out by running: $ mkfifo pipe_in $ mkfifo pipe_out 2.Connect pipe_in to pipe_out: TERM0: $ tail -f pipe_in > pipe_out 3.Send string hello world! to ...
user avatar
  • 113
1 vote
1 answer
933 views

How to redirect stdin using mkfifo? [closed]

I searched on askubuntu, stackoverflow and I found this: $ mkfifo fif.pipe $ bash script.sh < fif.pipe $ echo 'say HELLO' > fif.pipe (say command do something in the script) But after $ bash ...
user avatar
  • 11
1 vote
0 answers
122 views

Where should I place named pipe files on RHEL7?

I done some quicky web searches to find out how to make a named pipe. It looks very straight forward I just need to execute as root: mkfifo filename, but what the best practice on where on the ...
user avatar
  • 2,113
2 votes
1 answer
1k views

How to create a bidirectional pipe in bash?

I have a program which reads from and writes to file descriptor 3. I want to let it write to fd 3, and be able to write to the other end of the pipe interactively which the program should read over ...
user avatar
0 votes
1 answer
690 views

Process substitution vs FIFO (created by `makefifo`)

As far as I know, process substitution in bash and FIFO (created by mkfifo) are both named pipes. They both seem viable solutions for communication between processes. I was wondering how to decide ...
user avatar
  • 90.6k
0 votes
1 answer
65 views

When does a command in a process substitution or FIFO start and finish running?

When does a command in a process substitution in bash start and finish running? E.g. when does command1 in command2 >(command1) start and finish running respectively? when does command3 in ...
user avatar
  • 90.6k
2 votes
1 answer
6k views

What is the purpose of using a FIFO vs a temporary file or a pipe?

From APUE FIFOs can be used to duplicate an output stream in a series of shell commands. This prevents writing the data to an intermediate disk file (similar to using pipes to avoid intermediate ...
user avatar
  • 90.6k
5 votes
1 answer
5k views

How does this command work? mkfifo /tmp/f; cat /tmp/f | /bin/sh -i 2>&1 | nc -l 1234 > /tmp/f

Today I was reading the nc man page and stumbled on this command. I know that: mkfifo /tmp/f is creating a named pipe at /tmp/f. cat /tmp/f is printing whatever is written to that named pipe and the ...
user avatar
2 votes
1 answer
1k views

pipe data into process that's already started

Say I start a node.js process like so: node script.js & is there a way to pipe data into that process after it has started? normally, we do this: cat <file> | node script.js but the ...
user avatar