The tag has no wiki summary.

learn more… | top users | synonyms (1)

1
vote
1answer
20 views

Custom python REPL with fifos

Is it possible to make a custom REPL (for e.g. python) with two fifos? Explanation of the problem Suppose I have two fifos in and out. I have three terminals. In the first I want to run commands ...
0
votes
2answers
40 views

mkfifo - Does disk I/O actually occur?

I have 2 applications: Producer (N instances) Consumer (1 instance) I currently write out intermediate results from the producers, and then the consumer reads these files from disk and produces a ...
1
vote
1answer
69 views

Why doesn't this piped script work?

#!/bin/bash rm out mkfifo out nc -l 8080 < out | while read line do echo hello > out echo $line done If I browse to the IP of the machine this script is running on (using port ...
3
votes
1answer
30 views

Can close() block?

For example, if you close a pipe or socket that still has data in its write buffer that hasn't been read by the process on the other end, does close() block until the data is read or the other process ...
5
votes
1answer
173 views

How do I use inotify or named pipes over SSHFS?

Thanks sshfs magic, I can mount my home dir from a remote server with sshfs user@server:/home/user ~/remote Optimistically, I thought I'd set a local inotify-hook on ~/remote/logFile (in the sshfs ...
4
votes
1answer
175 views

Communicating from bash with grunt shell

I'm tired of the slow startup time of hadoop fs just to query HDFS. This isn't a problem with HDFS itself though, because using HDFS file system commands within the Pig "grunt shell" is pretty fast. ...
2
votes
2answers
499 views

continuous reading from named pipe (cat or tail -f)

I have configured rsyslog to log certain log events to /dev/xconsole: *.*;cron.!=info;mail.!=info |/dev/xconsole /dev/xconsole is a named pipe (fifo). If I want to see what is being logged, I ...
5
votes
1answer
97 views

What are the difference between those four commands (fifo, process substitution, redirection…)

My goal is to create a simple echo server using nc and a single fifo. I'm not looking for the best way to do it, I'm merely trying to understand the semantics of the following commands (when does fork ...
1
vote
1answer
61 views

How to redirect logs to a fifo device?

I have the following line in the rsyslog config file: *.*;auth,daemon,kern,user -/dev/logi and it does what it should, but I wanted to send some iptables logs to a different file, so I added the ...
1
vote
3answers
135 views

How to remove all FIFO files with a shell command

I can't find a shell command to remove all the FIFO files inside a directory. In fact, for the removal of directories, the rm command offers the options -d, --dir, but for FIFOs it offers no option. ...
2
votes
1answer
212 views

closing the unwanted file descriptors

I am trying to understand how pipes work . This code snippet is from some website . So my understanding of the program goes like this : When we do pipe(fd) then fd[0]=3 and fd[0]=4 ( assuming only ...
3
votes
1answer
292 views

Prevent hanging of “echo STRING > fifo” when nothing is reading that FIFO

When I echo something to a named pipe made with mkfifo, it hangs if no process is reading from that pipe. How can I prevent that, i.e., stop that from hanging? And by the way, why is that hanging ...
0
votes
1answer
260 views

Using Fifo hang script

out="$katalog/out" # wyjscie fifo="$katalog/fifo" # wejscie mkfifo $fifo touch $out [...] #k ./a.out <$fifo >$out & pid=$! [...] # get input line by line loop start echo "$liniain" >> ...
6
votes
1answer
453 views

bash scripting - read tarball from stdin

I have a task I need to script that I feel should be stupidly simple, but I'm actually having a rather tough time. I have a short bash script that takes a specific type of application in tarball form ...
4
votes
5answers
401 views

Semi-asynchronous pipe

Assume I have the following pipe: a | b | c | d How to wait for completion of c (or b) in sh or bash? This means that script d can start any time (and does not need to be waited for) but requires ...
2
votes
1answer
647 views

How can I pipe commands to any terminal?

I often use more than one terminal (or terminal emulator) at a time; and while in X I can copy-paste commands, besides not being very practical, it obviously does not work on the real TTY. The first ...
0
votes
0answers
152 views

Reading from named pipe freezes when piping tshark output

I'm trying to implement a web prefetching system. The purpose of a system like this is to “predict” future requests and prefetch them. The system builds a predictive model from web navigation logs ...
5
votes
2answers
314 views

A virtual file containing the concatenation of other files

Is there a way of creating a filesystem object akin to this: mknod files p cat file1 file2 ... fileN > files but such that it can be seeked in, as if it were a regular file?
0
votes
1answer
283 views

Cat into fifo not running through bash

I want to script these few lines mkfifo my.fifo cat >my.fifo & cat my.fifo | nc remotehost.tld 10000 But the line cat >my.fifo & When i run it manually it works, but not through ...
2
votes
2answers
951 views

Why does a named pipe not get deleted after system restart?

As far as I understand, named pipes are not written to disk but are stored in memory. Here's how I created a named pipe - $ mkfifo pipe21 $ grep "simple" SimpleDoc.txt > pipe21 & [1] 2775 $ ...
1
vote
2answers
1k views

Cheapest way to find the oldest file (recursively) from a directory under heavy load

What is the least expensive way to find the oldest file in a directory, including all directories underneath. Assume directory is backed by SAN and under heavy load. There is concern that "ls" could ...
4
votes
2answers
658 views

Problem with pipes. Pipe terminates when reader done

I am on OSX, using bash, trying to make sense of pipes. I wish to let a program communicate in two directions with a bash shell. I want to set this up in such a way that this is always the same shell, ...
2
votes
2answers
593 views

Does named pipe modify the filesystem?

As title. If I create a named pipe and then read/write on it, is the filesystem where the named pipe resides affected? I.e. is the data buffered on the filesystem until read, or does it reside in ...
9
votes
4answers
4k views

Are FIFO, pipe & Unix domain socket the same thing in Linux kernel?

I heard that FIFOs are named pipes. And they have exactly the same semantics. On the other hand, I think Unix domain socket is quite similar to pipe (although I've never made use of it). So I wonder ...
1
vote
2answers
223 views

where are the “files” of ipcs and why are named pipes (mkfifo) not listed in ipcs

I was researching about linux shared memory and stumbled upon this ipcs command. From the man page: ipcs - provide information on ipc facilities ipc is not explained in the man page but it most ...
3
votes
3answers
588 views

Can't process stdout with pipe as it comes

I'm running tshark on a fifo, and the following is a bare example of a loop that prints the output of tshark as it comes: tshark -i $fifo | while read line; do echo $line done The problem ...