Questions tagged [fifo]

22 questions
7
votes
1 answer

Multiple unix pipes not working

This first pipeline works fine (printing "c"): echo "a" | sed 's/a/b/' | sed 's/b/c/' This one does not do what I expect (nothing gets printed when I feed an "a" into my fifo ): mkfifo fifo; cat fifo | sed 's/a/b/' | sed 's/b/c/' However, if I…
Sridhar Sarnobat
  • 1,395
  • 2
  • 13
  • 25
7
votes
3 answers

Read non-blocking from multiple fifos in parallel

I sometimes sit with a bunch of output fifos from programs that run in parallel. I would like to merge these fifos. The naïve solution is: cat fifo* > output But this requires the first fifo to complete before reading the first byte from the second…
Ole Tange
  • 4,529
  • 2
  • 34
  • 51
6
votes
1 answer

How long do FIFOs (named pipes) stay "open" for?

For example, I have a script that writes the time to a pipe in /etc/pipe. It writes continuously in a while true loop. How long will the data in the pipe be available for reading? If I only decide to read the pipe a day later with cat /etc/pipe,…
n0pe
  • 16,472
  • 18
  • 71
  • 102
5
votes
2 answers

How to prevent terminating command to send EOF to named pipes?

The problem I faced is exactly this one: http://www.linuxmisc.com/4-linux/d7863c256bccbfb6.htm I want to be able to run a program which takes stdin, and write data to it whenever I feel like it. I can do this with fifo named pipes. e.g.:…
justhalf
  • 174
  • 1
  • 9
5
votes
3 answers

Can bash consume the same fifo from two separate commands?

I have a huge data source that I'm filtering using some greps. Here's basically what I'm doing right now: #!/bin/bash param1='something' param2='another' param3='yep' echo $(avro-read /log/huge_data | grep $param1 | grep "$param2-" | grep $param3 |…
Andrew
  • 321
  • 3
  • 9
5
votes
1 answer

can't scp a named pipe

I am trying to encrypt a file on-the-fly, redirecting the output to a named pipe [fifo]. I SSH into my server and run the command: $ mcrypt -k key < file > named_pipe then from my laptop I try to scp it: $ scp…
Matt
  • 767
  • 1
  • 11
  • 18
4
votes
2 answers

Keeping bash open on a named pipe

I'm looking to send commands to a separate tmux pane from vim and I figured the easiest way was to mkfifo a named pipe /tmp/cmds and run bash < /tmp/cmds to listen for commands to run. I then do echo "echo \"hello world\" > /tmp/cmds" as test, this…
William Casarin
  • 990
  • 1
  • 8
  • 15
4
votes
2 answers

How can I redirect sound to a FIFO file?

I have a program which uses FIFO files for interacting with the user. An audio call can be made directing the output of arecord to one of the program's FIFO files: arecord -r 48000 -c 1 -f S16_LE > call_in An audio call can be answered by directing…
2
votes
1 answer

How to pipe the output of a linux command back into the predecesssing command

The linux command nc -l 8090 | (read METHOD URI PROTOCOL ; echo "method: $METHOD" ; echo "path: $URI" ; echo "prot: $PROTOCOL") listens to port 8090 and when I type something like http://127.0.0.1:8090/path/to/nowhere into my browser it prints out…
jederik
  • 127
  • 4
2
votes
1 answer

how to convert a script using pipelines to named pipes

I have a bash script that is using anonymous pipes to achieve: grabbing video from dv capture device writing to a file (using tee) piping it to ffmpeg2theora (converting to ogv/theora video) writing to a file (using tee) piping it to oggfwd in…
Luka
  • 21
  • 4
2
votes
1 answer

Shell pipes - the order of things

Because netcat on my box doesn't support -e, The netcat man page gives me this workaround: $ rm -f /tmp/f; mkfifo /tmp/f $ cat /tmp/f | /bin/sh -i 2>&1 | nc -l 127.0.0.1 1234 > /tmp/f I don't understand how this works. I though that when you try to…
Drew LeSueur
  • 595
  • 1
  • 8
  • 13
2
votes
1 answer

Why does du -sk fail to report the size of a fifo?

There is a concept in bash called process substitution. You can run a command and use the output as a file. e.g. $ cat -n <(seq 3|tac) 1 3 2 2 3 1 I am curious why the following fails; $ du -sk <(xzcat /var/log/mpd/scribble.log.xz…
2
votes
0 answers

ffmpeg: convert mjpeg fifo into mp4 stream - on the fly- to render in chromium

I have a mjpeg stream in a fifo (comes from gphoto2 --capture-movie) and I want to play that stream in chromium. To capture the mjpeg stream I use: gphoto2 --capture-movie --stdout> fifo.mjpg Now I'm having hard times to figure out how to convert…
pixelbash
  • 31
  • 6
1
vote
1 answer

How to implement FIFO functionality in RAID HDD

Can anyone please advice me on how to implement a FIFO functionality on a RAID 0 HDD. I want the old files to be over written after the space of the HDD is zero, so that the RAID acts like an infinite loop. Any ideas on how this is accomplished?
Jishnu U Nair
  • 263
  • 2
  • 4
  • 16
1
vote
1 answer

Can't delete, chown or chmod file even as root

I want to delete a backup of a website (FTP-mirrored with wget), but a single file, named js_composer.less resists. I can create new files and delete them in the same directory, so the problem might be with the file itself. It can't be…
1
2