Pipes or named pipes are a feature of the POSIX standard that allow separate processes to communicate with each other without having been designed explicitly to work together.

learn more… | top users | synonyms

0
votes
2answers
252 views

Format data as a table in bash

I have an array of JSON data being printed to the terminal (OS X) and I want the properties of that to be displayed in a table in the terminal. Sample query: aws ec2 describe-instances | jq '[ ...
0
votes
1answer
234 views

How can I pipe the output of *all* entered shell commands into another? (e.g. pipe everything into 'lolcat')

Good Afternoon, (OS X user) I am specifically trying to pipe the output of every shell command I type into the ruby gem 'lolcat' (which makes the output to the terminal rainbow colored). Is there a ...
0
votes
1answer
188 views

Why does echo work through pipe but not cat with msmtp?

This works: echo "yada yada" | msmtp my@mail.com but not this: cat yadayada.txt | msmtp my@mail.com which delivers the email with empty content. Why does echo work through pipe but not ...
1
vote
2answers
647 views

Using Piping with cat and less to concatenate 2 files

I'm fairly new to Unix commands and I just have a simple question. One exercise I'm working on wants me to use piping along with cat and less to concatenate 2 directories (in this case /etc/passwd ...
0
votes
2answers
842 views

tar piped to curl: This does not look like a tar archive

curl -L http://download.transmissionbt.com/files/transmission-2.80.tar.xz -s -o - | tar -xf - The error: tar: This does not look like a tar archive tar: Skipping to next header tar: Exiting with ...
1
vote
1answer
136 views

Having trouble piping output of dscl -list to -dscl read using xargs

I'm trying to get every user using dscl and reading each of their records using xargs and dscl. I'm not sure what I'm doing wrong, though, because I would expect this command to take each line of ...
1
vote
3answers
186 views

Pipe with ls command

When I want to know if a command is a link or not, I do like following. $ which locate /usr/bin/locate $ ls -l /usr/bin/locate lrwxrwxrwx 1 root root 24 5月 3 2012 /usr/bin/locate -> ...
0
votes
1answer
335 views

Running pdfcrack to include special characters in charset

I'm trying to recover a password from a PDF file using pdfcrack. I want to change the charset to include special characters. Can I use some kind of i/o redirect to feed the contents of a a similiar ...
1
vote
1answer
30 views

How do I save from VI to a pipe?

I've seen lots of ways to redirect input from stdin to VI, but I'd like to redirect VI to save to a pipe rather than a file. For example, I'd like to pipe VI's entire pipe buffer to another text ...
0
votes
1answer
204 views

Streaming log file contents (piping)

I am trying to understand how piping works and am stuck at this point. A log file is being streamed and its output is being piped to pigz. What I am trying to do is, redirect the pigz content to a ...
1
vote
1answer
185 views

Why the here-strings in bash are slower than piping the input to a command?

I compared the execution time for unix here-strings and pipe data input to bc: pipe time for i in {1..1000} do echo "sqrt(5.09)" | bc -q > /dev/null done real 0m3.584s user ...
2
votes
1answer
1k views

Pipe VLC output to ffplay?

I have a (broken) PC, where VLC plays videos on only the left half the screen, which seems related to OpenGL/drivers (see here). On the other hand, ffplay doesn't have the half-window problem, but can ...
0
votes
3answers
313 views

How to print out all non-hidden files recursively in a dir using lpr

find . -type f | grep -v '/\.' lists out all non-hidden files in the current dir recursively. Example of this command given the following file tree . ├── css │   ├── base.css │   └── main.css ├── ...
3
votes
2answers
336 views

Why is xargs necessary?

Suppose I want to remove all files in a directory except for one named "notes.txt". I would do this with the pipeline, ls | grep -v "notes.txt" | xargs rm. Why do I need xargs if the output of the ...
0
votes
1answer
112 views

redirect awk information to stdout

I am trying to gather information for CPU use for all the processors in a text file. mpstat -P ALL -u 1 | awk '{print $4}' > cpu.txt && mptat -P ALL -u 1 | awk '{print $4}' | tee cpu.txt ...
1
vote
1answer
470 views

Flushing a named pipe

I am using the following to redirect output from my script to both terminal and log file while appending date to every line that goes to the log file: NPIPE=/tmp/$$_$RANDOM.tmp mknod $NPIPE p tee ...
-1
votes
2answers
182 views

When did the windows command line get the pipe (|)? [closed]

I freely admit I have very little experience with the Windows cli but I seem to recall that DOS had no pipe (or redirect for that matter, but I may well be wrong, its been a while). I have seen some ...
3
votes
3answers
2k views

How to pipe data over tcp from the command line?

I would like to pipe data from one machine in the command line to another machine over tcp. I guess I could write a socket server but this must already be implemented. For example I could use it to xz ...
1
vote
1answer
294 views

grep with colored output returns several empty lines

I have strange issue with grep (2.12-2, debian testing). In some situations when I do something like this: grep -rni '."spacer">.' . grep return me several empty lines: If I add --color=none ...
1
vote
1answer
229 views

Shell script detecting errors from command called by script

I am calling applications from my shell script, which performs a number of important steps in sequence, one step being below: for database in $( echo 'show databases;' | mysql ...
1
vote
2answers
84 views

Finding folders only

My harddrive is in a mess, so I decided to do a cleanup. As a part of this, I want to merge all folders containing music into one. What I want to do is, look for any *.mp3's and *.aac's on my drive ...
0
votes
2answers
129 views

Dynamic terminal title: show server load status at X second interval

When I have a bunch of terminals open in my WM it would be nice if terminal window titles reflected current user and host (easy) along with dynamic server load details, updated at some interval ...
5
votes
1answer
2k views

Pipe not working in cmd.exe on Windows 7

I have started seeing some very strange issues with the pipe command not working on Windows 7 64-bit on my machine. Commands like this: echo test | more used to work without a problem, but now ...
0
votes
1answer
321 views

Reading the same stdin with two commands in bash

I would like to pipe an output of to two separate commands <2,3> in bash. What is the best way of doing this? At the moment, I have following script: command source > output command2 output ...
0
votes
2answers
191 views

Windows Vista piping dir output into attrib command

I had a virus or something on my computer that set the attributes for all the folders in the root of my external drive to system and hidden, and created shortcuts to them. I am now trying to remove ...
1
vote
1answer
257 views

Alias defined in .bashrc not working after pipe

I'm stuck with the following problem. I've defined an alias in .bashrc (and .bash_profile): alias echo2="echo" This works well: $ echo2 "test" test However, if I try to use it after a redirect, ...
2
votes
1answer
1k views

How to redirect multiple bash commands to a variable AND screen?

I would like to capture a subshell's output in a variable and print it in the terminal screen simultaneously. Is it possible to do this by assigning the subshell to a variable and piping stdout and ...
0
votes
1answer
500 views

piping output from curl to rpm2cpio

I download alot of srpms to rummage through, I used to go through a long winded approach, root@server$ curl rpm -o file.rpm root@server$ rpm2cpio file.rpm | cpio -id but that leaves behind an ugly ...
4
votes
3answers
119 views

Transparent usage of temporary files as means of piping

As many of us are surely aware, it's always a good idea to make your program accept stdin input. Very many programs do allow that *nix environments. This lets us do cool things like piping echo "foo" ...
5
votes
1answer
270 views

cat-ing a file to a unix pipe causes Matlab to freeze

I've created a named pipe on Debian using mkfifo pipe.in. I want to write to this pipe from Matlab. To do this, I use the following matlab command: unix( 'cat <myfile> > pipe.in' ) ...
2
votes
3answers
262 views

How do I make a bash alias that outputs file names in a format I can pipe to vim?

When rebasing with git, I'm interested to open the files that have merge conflicts. I can do this with: vi `git diff --name-status --diff-filter=U | awk '{print $2}'` but if I alias that: alias ...
0
votes
0answers
673 views

Rendering HTML from a pipe

I would like to be able to generate HTML then pipe it to a program which will render it, something like this: for i in 1 2 3 do for j in a b c do echo "<table ...
3
votes
1answer
216 views

Redirect stdout to multiple programs

I'm doing some stream processing of some quite substantial files-- I was wondering if there was a way to split stdout in order to pipe to multiple programs. What I'd like to do is something like this: ...
2
votes
2answers
105 views

use pipe inside a find exec statement

I'm trying to find which jar contain a class, I wrote the below, which doesn't seem to work any ideas? find -type f -name "*.jar" -exec jar -tvf "{}" \| grep MyClass \; -ls
2
votes
2answers
813 views

Setting pipefail for a single piped command

I need to execute a number of piped shell commands from a non-BASH script (namely PHP script) like these: command1 | command2 | command3 so that, if command1 fails with a non-zero exit code, each ...
4
votes
5answers
294 views

How do I pipe a list of numbers straight from the shell into a command?

How do I pipe a list of numbers straight from the shell into a command? For exampe something like this [1,2,3,4] | sort would give 1 2 3 4 EDIT: In response to the answers kindly posted so ...
3
votes
2answers
103 views

Mutual piping on linux

I would like the output of A to be input for B and at the same time the output of B to be the input for A, is that possible? I tried the naïve thing: creating named pipes for A (pipeA) and B (pipeB) ...
0
votes
2answers
198 views

Why cat $(find /usr/portage -name *.ebuild) | grep RESTRICT - works? And find | grep - not?

Why I can't grep find? Only helps grepping cat of find. As I see program grep could see some context in which every command runs. But it's counterintuitive for a newbie like me. When given with ...
0
votes
1answer
169 views

Linux: access mounted volumes as normal folders/files

I have a closed source software (client) running on a Linux machine (Debian) to deliver files to a backup machine. This works fine except this client software does not access the mounted volumes ...
0
votes
2answers
361 views

Linux output redirection not working with awk

I'm trying to write a nice csv-file based on some output from top. I reformat the output with awk like this: top -b | nawk '/Cpu/ || /Tasks/ { if($1 ~ /Cpu/) { printf "%s,",$3 } else { printf "\n" } ...
2
votes
1answer
71 views

.cmd script output only goes to pipe occasionally

I'm having a problem with a .cmd script only occasionally passing it's output through a pipe. The script is auto generated by npm and it runs jshint using node. Here's the script: :: Created by npm, ...
2
votes
2answers
669 views

Piping bash output to perl script's arguments

I have the following bash command: find repo -name '*.c' What I want to do is use the files returned as arguments to my perl script, so that it's equivalent to running: perl ./myscript file1.c ...
4
votes
1answer
93 views

Launch only the command if the previous one worked inside SSH, shell

I've got a SHELL script which is using a pipe to separate my two commands: ssh -oBatchMode=yes user@hostname "mysql -u yop -pyop -c yop | echo test" The problem is even if my connection to MySQL ...
2
votes
2answers
2k views

How do I unzip a compressed file as it's downloading?

I'm downloading a large file that's not an archive, and I want to combine the tasks of downloading and decompressing. How can I do them simultaneously?
2
votes
3answers
191 views

With regards to piping commands, what are the greater than (>) and less than (<) symbols called?

On linux at least, and I think windows/dos shell too you can use > to "pipe" output into a file. Something like: cat myfile.txt > mightAsWellCP.txt What is that piece of syntax sugar called? ...
2
votes
1answer
646 views

Unix bidirectional pipe on commandline

I've been able to use this linux command to connect Netcat to a serial port: nc -l 80 <> /dev/ttyS0 I would like to be able to log this transaction. My backup plan is to use Wireshark to ...
3
votes
2answers
349 views

How can I run several parallel shell jobs and monitor all of them at once?

I have a large number of large files (hundreds of files, hundreds of MB each) which I need to pipe through a number of programs to filter and convert them. I'm taking advantage of multiple CPU cores ...
0
votes
2answers
2k views

pipe: too many files open renders entire OS completely useless

I'm running Ubuntu 12.04, and I am having a major problem. Two separate times today, one of my open gnome-terminal sessions locked up and printed the error pipe: too many open files I realize ...
0
votes
1answer
644 views

Transcode moviefile to h264/aac with ffmpeg for video and neroacenc for audio

I'm on Mac OS 10.8.1, with ffmpeg-devel installed as a macport. I can run NeroAacEnc(win32) via Wine. I can transcode a movie into h264/aac using a simple ffmpeg command: ffmpeg -i INPUT.MP4 -vcodec ...
2
votes
3answers
681 views

count files in a list of directories

I have file with a list of directories that I would like to know how many files are in each directory. .../images/idsuffix/userids/ This will give me the count of files and directories for ...