continuous reading from named pipe (cat or tail -f)
I have configured rsyslog to log certain log events to /dev/xconsole:
I have configured rsyslog to log certain log events to /dev/xconsole:
I have a program that exits automatically upon reading an EOF in a given stream ( in the following case, stdin ).
Now I want to make a shell script, which creates a named pipe and connect the program’s stdin to it. Then the script writes to the pipe several times using echo and cat ( and other tools that automatically generates an EOF when they exit ). The problem I’m facing is, when the first echo is done, it sends an EOF to the pipe and make the program exit. If I use something like tail -f then I can’t send an EOF when I intend to quit the program. I’m researching a balanced solution but to no avail.
I’ve already found both how to prevent EOFs and how to manually send an EOF but I can’t combine them. Is there any hint?
Two windows, same user, with bash prompts. In window-1 type:
Thanks sshfs magic, I can mount my home dir from a remote server with
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 if they all refer to the same implementation in Linux kernel. Any idea?
Asks the kernel for an anonymous pipe. There is no name, so this can’t be done with open like for a normal file — instead it’s done with pipe or pipe2, which returns two file descriptors.⁴