Skip to content
Advertisement

Tag: pipe

Sending linux commands in Perl – Grep piped to grep

The basic code: Why wont Perl complete these commands correctly? $fail2ban is already defined to 0, so that’s not the issue. The fail2ban.log does contain a line that should match(when running command from shell it matches): The error i keep getting is: All the commands run fine from bash/shell, seems at if perl is not happy with grep being piped

Using unbuffered pipe as “dummy” file output

I’ve been dealing with a weird issue that I can’t find a way to solve. My situation is as follows. I have an application in python called “app1”, that requires a file for outputting the results of it’s execution. I have a secondary application, called “app2”; a binary, that gets the input from stdin. I want to pipe what “app1”

How to exit while loop when read() blocks

In a problem given by university we have to pipe from a parent process(P1) to its child P2, and afterwards P2 must pipe to another child of P1, the other child is P3. Both P2 and P3 are to be written in c and made into executable files. They will then by execed by child processes in P1. P1 writes

pipe command make standard input broken

I have two processes: t1.cpp and t2.cpp. t1.cpp and t2.cpp are simplified ,I want to describe the problem easily. After compiling t1.cpp and t2.cpp. I execute them in this way ./t1 | ./t2. Problems occur! cin >> x; in t2.cpp failed! I have no chance to type from the keyboard. It seems the pipe command implements by redirecting the STDIN_FILENO.

Linux piping find and md5sum not sending output

Trying to loop every file, do some cutting, extract the first 4 characters of the MD5. Here’s what I got so far: Problem is, I don’t see any more output at this point. How can I send output to md5sum and continue sending the result? Answer md5sum reads everything from stdin till end of file (eof) and outputs md5 sum

How to find a postion of the lowest value in the file?

How to output position of a line with the lowest value inside? I have a file with data like below: I need to find a lowest value from the last column and return its position Answer You can use this command in order to get only the line number where the value is shown(if the value appears more than one

Bash | pipe to bash function

In the attempt to pipe to a Bash function, I wrote this: However, in another context I am receiving the correct output plus this error message: “Segmentation fault (core dumped)”. Trying to debug it I ask if there is something wrong the way I am writing the code inside the function in order to get STDIN. Thanks a lot. Answer

Advertisement