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
3
votes
0 answers

Pipe python function's results

I have functions that return some results. I would like to access those functions as libraries: they will be imported and used in some larger scripts. That is straightforward. However, I would like to use those functions as separate scripts which…
kaligne
  • 3,098
  • 9
  • 34
  • 60
3
votes
3 answers

How to pass variable value from C++ to Python?

I have a sensor value which can be read using the C++ only because it was implemented using it , I want to pass location value (two float variable) of one sensor to Python. I have been reading a lot and I found shared memory , piping and more any…
ramtha Z28
  • 43
  • 1
  • 4
3
votes
1 answer

F# mysterious differences between piping and function application

Premise: I thought that the piping operator is nothing but syntactic sugar, thus x |> f should be exactly the same as f(x). Analogously, I thought that f (fun x -> foo) is equivalent to let g = fun x -> foo; f g But apparently there are differences…
Friedrich Gretz
  • 535
  • 4
  • 14
3
votes
4 answers

CPanel Email Piping to PHP

I have created a pipe script in CPanel and have placed the hashbang:#!/usr/bin/php -q at the beginning of my script. The script does run and places a log of the email into a table in my DB as it should. But...It sends an email back claiming that the…
Chris
  • 1,101
  • 3
  • 17
  • 33
3
votes
1 answer

gnuplot plotting using piped input

I would like to pipe data into gnuplot and plot it without entering the gnuplot command line or providing an existing script file. Eg a one-liner such as cat datafile | gnuplot and see the plot come up. Suppose the datafile is well formatted, such…
3
votes
2 answers

Error in piping java programs

I have a class RandomSeq which prints "args[0]" random doubles and a class Average which prints the average of StdIn. I'm using DrJava for writing codes and compiling.I've downloaded the StdIn and out libraries and put them in the same folder of my…
Zeta.Investigator
  • 911
  • 2
  • 14
  • 31
3
votes
1 answer

Unix piping - echo and cat

I am having trouble with the following command in Unix Bash Shell: echo "This is some text" | cat dashes - dashes "dashes" is a file containing the line of text: "---------------------------------" From my understanding, the left command's stout…
Vaderico
  • 629
  • 2
  • 8
  • 24
3
votes
1 answer

change a value based on a subset of another variable in dplyr

I have a data set that has muscle activity data from a group of athletes who have had an ACL reconstruction. I want to reassign the limb side to indicate the ACLR limb and uninjured limb. Looking at the dataset called EMG below, suppose John had a…
Matt Jordan
  • 567
  • 1
  • 5
  • 14
3
votes
2 answers

How can I pipe a Python process' output in Python?

I'm writing a program that downloads videos from YouTube, using youtube-dl. I used to call youtube-dl with subprocess: import subprocess p = subprocess.Popen([command], \ stdout=subprocess.PIPE, \ stderr=subprocess.STDOUT, \ …
Exeleration-G
  • 1,360
  • 16
  • 29
3
votes
1 answer

piping in UNIX doubt

In The Unix Programming Environment by K & P, it is written that " The programs in a pipeline actually run at the same time, not one after another. This means that programs in a pipeline can be interactive;" How can programs run at same time? For…
Happy Mittal
  • 3,667
  • 12
  • 44
  • 60
3
votes
2 answers

Resume last screen, if any

Basically i need to have a script that checks if there is a screen running as "serverman". If it exists, then resume it, otherwise create new. So i wanted to parse "sceen -ls" and check if there is one called "serverman". This is "screen -ls"…
Wyatt_LandWalker
  • 309
  • 1
  • 10
3
votes
1 answer

How to redirect output of a running process to a file in Linux Shell

I am trying a bit of experiments with airmon-ng script in Linux. Meanwhile i want to redirect output of a process "airodump-ng mon0" to a file. I can see the instantaneous output on the screen. The feature of this process is that it won't stop…
Nithin Jose
  • 1,029
  • 4
  • 16
  • 31
3
votes
1 answer

Error using pipes and exec.Second command does not exit

The code takes a command as input and executes it. Pipes are also handled. The issue is that suppose if i enter ls | grep x as command. The process grep does not exit and so the program halts. Any ideas. #include #include…
ZURA
  • 31
  • 2
3
votes
2 answers

Is #tap method in Ruby dangerous?

How does tap method work concurrencywise? Do I have to fear that if I do: some_object.tap { |o| # time-consuming operation 1 }.tap { |o| # time-consuming operation 2 } that, in the present or future, Ruby will try to do these operations…
Boris Stitnicky
  • 12,444
  • 5
  • 57
  • 74
3
votes
2 answers

Piping input to a shell command and keeping the created shell alive

My overarching program is a shell script. This shell script calls a C program that I need to pipe input to, and ultimately the C program will create a shell. However, when I pipe my input into the C program within the shell…