Questions tagged [piping]

This tag is appropriate for questions related to taking output from one operation and using it as input to a subsequent operation.

Questions concerning the chaining of command line calls where the output of one call is used as the input for another call should use this tag.

An example of piping would this Linux command:

grep -v bash /etc/passwd | grep -v nologin

The output from the first grep is piped into the second grep as input.

You can read more information about piping at Wikipedia.

351 questions
0
votes
2 answers

delete files and directories in a directory according to the names of another directory

This may be a simple question: I accidentally copied a whole directory (call it A) to another directory (call it B), and now I want to delete all the "directory_A files" from directory B. I realize that maybe piping is a good idea, but I don't know…
alittleboy
  • 10,616
  • 23
  • 67
  • 107
0
votes
2 answers

Parsing artist and track information from the output of ncmpcpp

I am trying to parse the output from ncmpcpp to get the artist and track title. The output from ncmpcpp --now-playing takes the form of (MM:SS) %ARTIST% - %TRACKTITLE% Example: (4:46) A Perfect Circle - Imagine Using traditional piping tools…
r3dd1t
  • 3
  • 2
0
votes
2 answers

windows piping to a c++ program

I have the following c++ program: #include using namespace std; //will find the last dot and return it's location char * suffix_location(char *); int main(int argc, char* argv[]) { if (argc < 2) { cout << "not enough…
elyashiv
  • 3,623
  • 2
  • 29
  • 52
0
votes
3 answers

Piping for a computer understanding

I understand that in piping a < b > c means to use the data of file b for input to program a instead of stdin, and write the output of program b to the file c instead of stdout. What I dont understand is how to give a piping command to use the data…
0
votes
3 answers

writing data from a program to a file

I'm using linux. Let's say I have a program named add. The program takes two numbers. so if I type in add 1 2 the answer is 3 //obvious what command will make this write out to a file named add.data I'm kind of a linux n00b. I was reading about…
Mawnster
  • 673
  • 3
  • 11
  • 18
0
votes
3 answers

Piping Perl Commands?

I'm currently trying to take my program and have it take user input, usually a text file then call an external script to count the words. The script I'm working on is essentially a "middle man" and I'm trying to get more familiar with piping to…
user1739860
0
votes
0 answers

PHP class to parse and send emails

I have Exim4 that pipes incoming emails to my PHP script. This PHP script should parse it, modify some headers and probably add some info like: This email was sent by example.com service. (both plain and html versions). What I'm looking is a PHP…
Serge Kuharev
  • 1,052
  • 6
  • 16
0
votes
3 answers

Making use of piped data in python

I'm working on a python 3 project that does the exact same thing as bash's 'wc' (Word count) command. The format for input looks like this: $ python3 myWC.py < fileName.txt I'd like to use the file given to count over the bytes, words, and lines in…
Shayde
  • 13
  • 3
0
votes
1 answer

Email piping not working for PHP script. Local delivery failed error

In cPanel I have piped the following to my script: alerts@XXX.com to |/home/XXX/public_html/client/inc/msg/mailReader.php I get the following email returned: This message was created automatically by mail delivery software. A message that you…
Dominick
  • 448
  • 5
  • 18
0
votes
1 answer

Piping not working within bash script when run from a GUI as opposed to bash shell

As part of my build process I'm trying to mount a DMG using hdiutil. I've written a shell script to do this, and because hdiutil asks for confirmation of the license agreement before opening, I have in my script something like yes | hdiutil ....…
Jake Petroules
  • 23,472
  • 35
  • 144
  • 225
0
votes
1 answer

PHP, return a set number of characters after finding the string in a string(variable)

I am trying to fetch details from an email pipe. the pipe returns the $message variable to me which contains allot of data. I want to be able to search the string for a specific value and return the next 'x' amount of characters. as an example, my…
Smudger
  • 10,451
  • 29
  • 104
  • 179
0
votes
1 answer

Multiple pipes in C, program waiting for input

I try to edit my post, since there were some issues with it. I am still lost, trying to multipipe my program. When I run the program, goes into a state where it just takes some input - a like, perhaps its because I am not getting input to the second…
user1090614
  • 2,575
  • 6
  • 22
  • 27
0
votes
1 answer

Special Piping/redirection in bash

(Firstly I've been looking for an hour so I'm pretty sure this isn't a repeat) I need to write a script that executes 1 command, 1 time, and then does the following: Saves both the stdout and stderr to a file (while maintaining their proper…
Anfurny
  • 134
  • 13
0
votes
1 answer

Piping without transmitting EOT

I'm looking for a way to pipe without sending an EOT (Ctrl-D), i.e. making these equivalent: bob@bob-pc:~$ cat porkchop porkchop and bob@bob-pc:~$ echo -n pork | cat porkbob@bob-pc:~$ chop No command 'chop' found
-1
votes
1 answer

problems reading output from ffmpeg

I am trying to read raw BGR24 image data from ffmpeg into a C++ application. The C++ application will then process the image further using openCV. jpg -> ffmpeg -> application -> openCV I started by storing the output from ffmpeg into a file and…
JLucas
  • 31
  • 3
1 2 3
23
24