Chains the standard streams of a series of commands

learn more… | top users | synonyms

15
votes
1answer
426 views

Make program first read from pipe, then from keyboard

Consider the interactive program interactive. I have to run this program fairly frequently, and each time I run it the first few commands are the same. Obviously, having to type those commands over ...
2
votes
2answers
465 views

Mplayer controls when using stdin playlists

I ran across this post: How can I retain the console input in mplayer when reading from stdin? But the answer there doesn't work for me. (and I can't comment due to not enough rep) I'm running the ...
6
votes
1answer
436 views

Why mkfifo behaves like a LIFO?

If i do. mkfifo /tmp/a echo 'one'>/tmp/a in the while from another terminal echo 'two'>/tmp/a and from a third terminal more /tmp/a Why i obtain as output of the last command this? ...
19
votes
5answers
5k views

How to make bidirectional pipe between two programs?

Everyone knows how to make unidirectional pipe between two programs (bind stdout of first one and stdin of second one): first | second. But how to make bidirectional pipe, i.e. cross-bind stdin and ...
9
votes
2answers
245 views

How a piped shell programs balance their output/input rates? [duplicate]

Possible Duplicate: Bash while loop and reading from pipe I come from web programming background, and find myself interested in one peculiarity of using a local shell. I understand that ...
1
vote
2answers
543 views

Print/Tee to console without passing output to pipe

Is there a way to print or tee one thing to the console and still pass something else through to the next pipe? Something like: echo dog | printOrWhatnot "PUTTING MY THING DOWN" | sed 's/dog/cat/g' | ...
2
votes
1answer
67 views

Changing compression in memory

I have some large files that I need to change the compression type of for input to a program--I need to unrar them and then gzip (or bzip2) them. However, they're highly compressed files and I don't ...
2
votes
3answers
516 views

How to make wc interpret standard in as a file list

I know that there are other ways to go about this, but I'm looking to be able to make wc interpret stdin as a file name or list of file names. For example, ls JP*/std* | wc would work the same as ...
7
votes
4answers
625 views

Creating a single output stream out of three other streams produced in parallel

I have three kinds of data that are in different formats; for each data type, there is a Python script that transforms it into a single unified format. This Python script is slow and CPU-bound (to a ...
2
votes
1answer
205 views

Piped command changes PID

I created a (Debian) init Script for an executable Jar file: [...] NAME=NameOfMyShellScript DAEMON="/usr/share/myApp/bin/$NAME" USER="myUser" PIDFILE="/usr/share/myApp/run/$NAME.pid" EXTRA_ARGS=" -c ...
3
votes
3answers
1k views

Bash while loop and reading from pipe

I have a Windows command-line program that I'm running in a Bash script in Ubuntu via wine. The Bash script basically looks like this: wine myprogram.exe | while read line do # Process line done ...
7
votes
2answers
9k views

Bash: How to read one line at a time from output of a command?

I am trying to read the output of a command in bash using a while loop. while read -r line do echo "$line" done <<< $(find . -type f) The output I got ranveer@ranveer:~/tmp$ bash ...
2
votes
0answers
333 views

How to redirect and use the framebuffer?

I need to work on the framebuffer to record what is being rendered. Now, I figure out how to convert the framebuffer in an image, I'm currently unable to obtain a constant stream of data from the fb ...
24
votes
6answers
2k views

Why can't I redirect a path name output from one command to “cd”?

I am trying to get cd to accept a directory name redirected to it from another command. Neither of these methods work: $ echo $HOME | cd $ echo $HOME | xargs cd This does work: $ cd $(echo $HOME) ...
3
votes
1answer
809 views

Help w/ Minimal Notifications? (Pipes?)

I am trying to instate a more minimally-graphic notification scenario in Arch Linux. Specifically, I've taken interest with programs such as dzen2 or conky that allow for more text-based status bars. ...
4
votes
2answers
422 views

Passing parsed output of sed to find (in this direction)

Well, I think you can find dozens of questions on this platform how to pipe find output to sed, but I haven't found anything for the reverse direction so far. What I want to do is modify my input, and ...
3
votes
1answer
170 views

Why doesn't “cvs --help | less” work?

I don't know why, but piping cvs --help to less doesn't work. Probably it's because cvs --help outputs not to standard output(1) or error output(2), but somewhere else. Could you tell me where does it ...
4
votes
2answers
4k views

File descriptor linked to socket or pipe in proc [duplicate]

Possible Duplicate: /proc/PID/fd/X link number i have a question regarding the file descriptors and their linkage in the proc file system. I've observed that if i list the file descriptors ...
3
votes
3answers
2k views

How do I use tee to redirect to grep

I don't have much experience of using tee, so I hope this is not very basic. After viewing one of the answers to this question I came across a strange beheviour with tee. In order for me to output ...
4
votes
3answers
1k views

How can I do the equivalent of tail -f with ls? [duplicate]

Possible Duplicate: Is it possible to follow a command (run repeatedly)? as one would follow a file using tail -f? I would like to monitor files that are being downloaded to a directory in ...
4
votes
3answers
347 views

Use command grep and locate

How I can make the grep command locate certain words in the files specified by the routes found by the locate command? locate my.cnf | grep user (I want that grep command search the word "user" ...
1
vote
0answers
166 views

Automatically start named pipe reader on startup?

I'm trying to run a script with root access from PHP. I can't do that because Apache's user, www-data, don't have root access because of security reasons. To fix that, I was advised to use a named ...
3
votes
1answer
356 views

Plotting the sleep/wait chain of a process

I often want to know why a process in the middle of a pipeline is sleeping and not busy processing data. My current method is: find the pid of interest sudo strace -pt pid to get the blocking ...
7
votes
3answers
2k views

How do I make python programs behave like proper unix tools?

I have a few Python scripts laying around, and I'm working on rewriting them. I have the same problem with all of them. It's not obvious to me how to write the programs so that they behave like ...
1
vote
1answer
2k views

Flush 'tail -f' buffer?

I'm using the following statement (simplified version): tail -f -c+1 <filename> in order to pipe a file to a process. What I've found, though, is that there is a number of lines at the end ...
2
votes
1answer
657 views

Memory ussage for TCP or named pipe message buffers?

I have a group of programs that I was stress testing today. I drastically shot up the input load to the program and it worked at first, but I had an apparent memory leak sucking up memory. The only ...
2
votes
2answers
2k views

What's the difference between STDIN and arguments passed to command?

I could use the either form to execute the cat method: cat file_name cat < file_name The result is the same Then I want to execute man in the format of STDIN man < file_name For the ...
0
votes
1answer
213 views

The “cp p2 &2 &” command makes Konsole to disappear, is it a bug?

The goal is start a background process that copies the data from the pipe p2 to the STDOUT as p2 is feed with data by some other process. I guess the command is incorrect. Nevertheless, the Konsole ...
23
votes
1answer
977 views

Why does echo >file use more real time than echo | sed >file?

The example, below, surprised me. It seems to be counter intuitive... aside from the fact that there is a whisker more user time for the echo | sed combo. Why is echo using so much sys time when it ...
3
votes
1answer
2k views

pipe the output of parec to sox

sox is probably the one linux program that continues to frustrate me. At the same time, I am awed by what it can do, and I'd like to get close to being fluent in it, if not mastering it. Today, I've ...
4
votes
2answers
993 views

Behavior of stdin/stdout in conjunction with subshells and cd command

I have the following series of commands: cd / && ls | ( cd /tmp && cat >dumpfile) This series of commands does the following: it creates a file named /tmp/dumpfile. This file ...
96
votes
1answer
5k views

Bash: What does “>|” do?

I have just seen this written down; $ some-command >| /tmp/output.txt Vertical pipes are used in standard redirects "piping" the output of one command to another, is >| in fact completely ...
1
vote
1answer
347 views

Naming the output of convert command and piping it to mail

Here is what I'm trying to do: convert -strip -interlace Plane -gaussian-blur 0.05 -quality 85% -resize 35% 189_0538.JPG - | uuencode - img.jpg | mail -s "Some Picture" someid@somemail.com The ...
2
votes
1answer
251 views

password problem when feeding a remote file into diff

When I want to compare a local file with a remote file, any of these usually works: $ ssh remote cat file | diff file - $ diff file <(ssh remote cat file) However, sometimes (especially when the ...
2
votes
5answers
683 views

Where are command line arguments (e.g. 'some.text') actually passed to?

From what I know, parameters you pass to a command, goes to it's STDIN stream. so this: cut -d. -f2 'some.text' should be perfectly identical to this: echo 'some.text' | cut -d. -f2 as we send ...
4
votes
3answers
1k views

Why piping find and grep returns nothing?

I'm trying to have grep search inside specified files that are returned by find: find . -type d -name 'mydir*' -exec find '{}' -name '*.java' \; | grep 'MyClass' This doesn't work. Meanwhile, ...
6
votes
3answers
9k views

Pipe find into grep -v

I'm trying to find all files that are of a certain type and do not contain a certain string. I am trying to go about it by piping find to grep -v example: find -type f -name '*.java' | xargs grep -v ...
11
votes
3answers
4k views

Find -exec + vs find | xargs. Which one to choose?

I understand that the -exec can take a + option to mimic the behaviour of xargs. Is there any situation where you'd prefer one form over the other? I personally tend to prefer the first form, if ...
3
votes
3answers
607 views

Using CSV line as command parameters

I have a CSV file like: Name,Age,Address Daniel Dvorkin,28,Some Address St. 1234 (... N ...) Foo Bar,90,Other Address Av. 3210 And I have a command that take this parameters: ./mycommand ...
5
votes
1answer
468 views

Redirect terminal output to image file

I need to programmatically run some unix commands and get the output in a image file, the format could be png or jpeg (jpg). The commands are run in an AIX (IBM *nix) machine. I don't have ...
5
votes
5answers
847 views

resolve all ip addresses in command output using standard command line tools

I have several log files that contain a bunch of ip addresses. I would love to be able to pipe the data through a program that would match and resolve ip addresses. I.E. cat /var/log/somelogfile | ...
18
votes
4answers
745 views

Is there a way to pipe the output of one program into two other programs?

Sorry if this is a silly question but I'm trying to accomplish something like this but on one line: $ prog1 | prog2 $ prog1 | prog3 So, I basically want to execute prog1 and pipe the output to ...
3
votes
3answers
105 views

How to include program which only works with in/out files into a pipeline?

I need to process image with several tools in a pipeline tool1 | tool2 | tool3 | .... It appeared though that one of the tools isn't designed to work in a pipeline and only works in format of ...
4
votes
2answers
4k views

Alternate FIFO device for Linux with a (way) bigger buffer while still having filesystem semantics?

I am developing something that consists of a program I made generating output, and a program I did not make (and would very much like not to have to alter it) consuming it. I am using a named FIFO ...
0
votes
1answer
197 views

Check for failure of piped command [duplicate]

Possible Duplicate: Get exit code of process that's piped to another If I pipe the output of one command into another, is there a way for me to check explicitly whether the first ...
1
vote
2answers
640 views

Is there any other way to use tail -f for grep -q && operation?

I found this solution: http://stackoverflow.com/questions/7178888/grep-q-not-exiting-with-tail-f but is there any other possible? UPD: I want to do tail -f | grep -q something && echo ...
1
vote
1answer
181 views

Magic file that redirects to standard output

Is there a magic file name that gives the following effect? $ mkfifo /tmp/fifo1 && cat /tmp/fifo1 & $ foo --log-file /tmp/fifo # now I can see the log as the program runs I want ...
8
votes
3answers
4k views

Using in/out named pipes for a TCP connection

I've been fiddling with getting this to work for a while now, so I suspect some sort of fundamental misunderstanding about how pipes work is the root cause of my troubles. My goal is to initiate a ...
15
votes
5answers
1k views

Conditional pipeline

Say I've got the following pipeline: cmd1 < input.txt |\ cmd2 |\ cmd4 |\ cmd5 |\ cmd6 |\ (...) |\ cmdN > result.txt Under certain conditions I would like to add a cmd3 between cmd2 and cmd4. ...
36
votes
4answers
4k views

In what order do piped commands run?

I've never really thought about how the shell actually executes piped commands. I've always been told that the "stdout of one program gets piped into the stdin of another," as a way of thinking about ...