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
11
votes
1 answer

PHP - Filtering Email Body, Removing Reply Quotes

I'm working on an email piping script that needs to save just the reply content and not the original quoted email. I'm using a mime parser class (http://www.phpclasses.org/package/3169-PHP-Decode-MIME-e-mail-messages.html) to get all the information…
davishmcclurg
  • 409
  • 4
  • 14
11
votes
3 answers

Python piping on Windows: Why does this not work?

I'm trying something like this Output.py print "Hello" Input.py greeting = raw_input("Give me the greeting. ") print "The greeting is:", greeting At the cmd line Output.py | Input.py But it returns an EOFError. Can someone tell me what I am…
Nope
  • 34,682
  • 42
  • 94
  • 119
10
votes
2 answers

Problem with piping commands in C

I'm trying to create a simple shell in C for Unix. I've been able to do all the parsing of commands and execution, but I'm having a problem with piping. I think the problem is that I'm not hooking into the correct pipe for the input of the second…
mbxtr
  • 2,323
  • 1
  • 15
  • 12
10
votes
3 answers

Piping find results into grep for fast directory exclusion

I am successfully using find to create a list of all files in the current subdirectory, excluding those in the subdirectory "cache." Here's my first bit of code: find . -wholename './cach*' -prune -o -print I now wish to pipe this into a grep…
eternalnewb
  • 303
  • 1
  • 2
  • 10
9
votes
3 answers

Piping as interprocess communication

I am interested in writing separate program modules that run as independent threads that I could hook together with pipes. The motivation would be that I could write and test each module completely independently, perhaps even write them in…
user45743
  • 449
  • 1
  • 6
  • 8
9
votes
2 answers

Pipe implementation

I am trying to implement a linux shell that supports piping. I have already done simple commands, commands running in background, redirections, but piping is still missing. I have already read about it and seen some snippets of code, but still…
nunos
  • 20,479
  • 50
  • 119
  • 154
9
votes
2 answers

Extract attachments when piping mails to PHP

I know with my cPanel hosting I can pipe an email inbox to a script, but what I want to do is: Send to hi@hi.com Pipe to mail.php mail.php reads the subject, and a .txt attachment The contents of the subject and .txt attachment are stored in the…
tarnfeld
  • 25,992
  • 41
  • 111
  • 146
8
votes
2 answers

R - Running a t-test from piping operators

Is it possible to run a t.test from piping operators? I tried to find the answer to this, but most of the questions around this topic look at doing many tests on the same dataset. I've looked a broom package, but it seems to be good for reading the…
jmich738
  • 1,565
  • 3
  • 24
  • 41
8
votes
2 answers

Why is function composition in F# so much slower, by 60%, than piping?

Admittedly, I am unsure whether I am correctly comparing apples with apples or apples with pears here. But I'm particularly surprised about the bigness of the difference, where a slighter difference, if any, would be expected. Piping can often be…
Abel
  • 56,041
  • 24
  • 146
  • 247
8
votes
2 answers

Using dplyr, how to pipe or chain to plot()?

I am new to dplyr() package and trying to use it for my visualization assignment. I am able to pipe my data to ggplot() but unable to do that with plot(). I came across this post and the answers including the one in comments, didn't work for me.…
sadiqsaleem
  • 83
  • 1
  • 1
  • 5
8
votes
3 answers

printf, ignoring excess arguments?

I noticed today Bash printf has a -v option -v var assign the output to shell variable VAR rather than display it on the standard output If I invoke like this it works $ printf -v var "Hello world" $ printf "$var" Hello world Coming…
Zombo
  • 1
  • 62
  • 391
  • 407
7
votes
2 answers

Piping data between threads with Java

I am writing a multi-threaded application that mimics a movie theater. Each person involved is its own thread and concurrency must be done completely by semaphores. The only issue I am having is how to basically link threads so that they can…
JuggernautDad
  • 1,135
  • 2
  • 13
  • 28
7
votes
2 answers

C++ genetic programming: Invoking a linker/compiler, executing the compiled program and piping input / output

This is a generic question, and although I'm pretty sure some of it's parts have been answered I want opinions rather than a broad discussion. I intend to do a master thesis on evolutionary computation and genetic programming, and I would like…
Ælex
  • 14,432
  • 20
  • 88
  • 129
7
votes
1 answer

Subset vector not containing word in piped operation in R (regex)

How do I subset a vector for elements that do not contain a word in a piped operation? (I'm really into piping) I'm hoping there's some way to invert str_subset. In the following example, I'd like to just return the second element of x instead of…
David Rubinger
  • 3,580
  • 1
  • 20
  • 29
7
votes
3 answers

Type inference with piping or composition fails, where normal function call succeeds

I rarely have this struggle nowadays with F#, but then again type inheritance is much less common with F#, so perhaps I was just lucky. Or I am missing the obvious. Normally when the compiler complains about not knowing a certain type I reverse the…
Abel
  • 56,041
  • 24
  • 146
  • 247
1
2
3
23 24