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
Tag: pipe
Using sed to replace uppercase to lowercase, space to underscore then create a xml file with results
Apologies ahead of time if this is stated wrongly as I have searched but could not find how to sed + echo while using while loop to read a file. I have a before.txt file that looks like this: and I need it to look like this: This is what I have so far … But it fails How do
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.
Output a linux command to a url/port or scocket instead of writing it to a file
I have a command which out outputs certain data which i store in a ext file using a ‘>>’ command.Now Instead of doing that I want to have a socket or a port on any server which will catch the output of the command.Basically i want to output all my script data to a socket or url which ever is
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
Father-child process use pipe to talk, hangs after “execlp”, why?
I’ve got a simple text file called “tmp” under current directory, I wish to “cat” this file and then “sort” it, I want to use a c program to act like pipe “|” so I tried to use a father/child talk to do this. Unexpectedly, the program hangs after “cat”, like below: g++ to compile and run this file, after