Questions tagged [pipe]
A pipe is an interprocess connection between file descriptors of two processes. A pipe is created with the POSIX pipe() function (from <unistd.h>). Shells create pipes between processes if the "|" symbol is used: "cmd1 | cmd2" directs the output of cmd1 to the input of cmd2. On Windows use CreatePipe(). This mechanism redirects standard input, standard output, and standard error into the calling process in .NET and Java.
9,950
questions
1
vote
0
answers
14
views
Make Docker a proper UNIX citizen
I'm trying to write a wrapper over Docker to propagate signals and standard output in a sensible way. First, Docker doesn't handle SIGPIPE nicely:
$ docker run --rm ubuntu yes | head
y
y
y
y
y
y
y
y
y
...
-1
votes
2
answers
66
views
BASH: Assign values to variables with echo | sed | read [duplicate]
I'm trying to pass a string through a pipe going from echo to sed to read, but something isn't working:
#!/bin/bash
STR="alef|bet|gimel|daled"
echo $STR
echo $STR | sed 's/\|/ /g' | read ...
0
votes
0
answers
17
views
Piping yt_dlp to FFMPEG using python: ffmpeg failing to recognize video data from pipe
I am trying to pipe the output of yt_dlp into a pipe used by ffmpeg which then outputs.:
def pipe_function(url):
ydl_command = [
'yt-dlp', '-f', 'bestvideo+bestaudio', '--quiet', '--no-warnings', ...
2
votes
0
answers
39
views
Using Pipes for Stream Data in FFMPEG
I am trying to input stream and decrease the bitrate of the video without saving it anywhere so i am hoping to pass it as a stream and get the output as a stream and send it to digital ocean spaces to ...
0
votes
1
answer
55
views
imagemagick pipe to ffmpeg
I'm trying to write a batch file for a friend to make timelapse videos. I'm using avisynth, but she's even more clueless than I, so I tried to do most of the work with ffmpeg.
What I'd like to do is ...
0
votes
0
answers
14
views
MIT6.828: Why do I get a pagefault when I use pipe the first time in my xv6 operating system?
I am now self-learning mit6.828, this course is about studying operating system xv6. This system boot with initiating memory system, user environment system, trap system ,multiprocessors and a file ...
1
vote
0
answers
49
views
execve system call returning an unexpected output
So I've been working on a mini project in C about piping and processes in Linux.
A program is executed like this:
./a.out "file1" "cmd1" "cmd2" "file2"
It ...
2
votes
0
answers
30
views
Python Multiprocessing with Pipe: Subprocesses sleep forever when training deep reinforcement learning agent with no error raised
I was using Pytorch-based Deep Reinforcement Learning (DRL) agent to train the environment with Multiprocessing package to train in multiple processes (thanks to the renowned elegantrl framework).
To ...
-2
votes
0
answers
62
views
C++: Why does `assert(pipe(stdin_fd) == 0)` set file descriptors to zero? [duplicate]
I am writing C++ code for inter-process-communication, where I create pipes to exchange data between parent and child (created using fork()) processes.
I declare file descriptors for setting up pipes ...
0
votes
0
answers
37
views
capture hash value from git log --oneline --graph using regex [duplicate]
When running git log --oneline --graph you can get something like this
* 7e5dbb0 Merge
|\
| * c873a96 My
| * f5817ba Amazing
* | f6a34ac Feature
|/
* f5a51ce Other stuff
I want to take that and ...
-1
votes
0
answers
38
views
Tomcat: Too many files open. FIFO pipes
I have this problem for a while now with one of my tomcat server running an java application.
When I start the tomcat it slowly starts opening this kind of pipes
java 10329 tomcat 427u a_inode ...
1
vote
0
answers
62
views
Handling Large Text Files with Pipes in C: Minimizing and Debugging a Word Frequency Counter
This program is a minimized version of a larger project that processes text files to generate CSV output with word frequencies. The full version works well for small to medium-sized files but ...
0
votes
1
answer
44
views
Why isn't ERRORLEVEL giving the correct value in my batch file
I am trying to write a batch file that will test all local groups and report if a user belongs to the group.
Here is my code:
echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%G ...
3
votes
1
answer
67
views
Why do I get different outputs for calling "replicate" with and without pipe "%>%" in R?
I want to generate a character vector with 20 elements, each has a random string.
So I generate a random string with the following code:
sample(x = c(letters, LETTERS), size = sample.int(100, 1), ...
-2
votes
1
answer
46
views
I am getting this error Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='cp1252'> OSError: [Errno 22] Invalid argument
I cat some logfiles into a python script which I then pipe into head as follows:
cat *mongodb.log.* | python jsonFetcher.py -b 20240101000000 -e 20250101000000 | head
the output is as follows, I am ...