Tagged Questions

Chains the standard streams of a series of commands

learn more… | top users | synonyms

0
votes
1answer
12 views

Create a temporary file from a stdout redirect or pipe

Some commands only output to stdout. Some tools only work on files. Is there a command that can glue those together? Contrived simple example: diff $(echo 1 | stdout-to-temp-file) $(echo 2 | ...
1
vote
2answers
60 views

Difference between > and | with /dev/tty

When I run this command: echo "1" > /dev/tty # runs successfully but when I run this: echo "1" | /dev/tty #permission denied What is the difference between these two operators > and | and ...
3
votes
4answers
76 views

How to send stderr to stdout with a pipe to another command?

I'm trying to capture all of the output of a build operation, and send it to myprogram. I seem to only be able to capture part of it. This is what I'm trying: make clean && make ...
3
votes
3answers
37 views

Utility to buffer an unbounded amount of data in a pipeline?

Is there a utility that I can stick in a pipeline to decouple read and write speeds? $ producer | buf | consumer Basically, I want a utility buf that reads its input as fast as possible, storing it ...
3
votes
1answer
20 views

Repeatably generate a read error for testing?

I'm trying to test the error handling in some software, in particular what happens when an error occurs reading from a file or pipe. Is there a simple way to send a certain amount of data to stdout ...
4
votes
2answers
47 views

How to add a timestamp to each line of a logfile?

I have an external program which I can not edit. It writes its log to a file. How do I add a timestamp to each line while the program writes to the logfile? It does not write its output to stdout. ...
6
votes
2answers
138 views

bash: Piping for loop output prevents local variable modification

First off, sorry for the title. I'm not sure of the correct terminology so if anyone can improve upon it that would be good. I am trying to write a simple bash function that takes, as it's arguments, ...
5
votes
1answer
96 views

How can I tell if the pipe buffer is full?

I am piping output from one program into some Perl I wrote. This is a long running process , sometimes days, so I want to find out where my bottlenecks are and try to open them up. I want to know if ...
6
votes
4answers
71 views

Difference between 2>&1 > output.log and 2>&1 | tee output.log

I wanted to know the difference between the following two commands 2>&1 > output.log and 2>&1 | tee output.log I saw one of my colleague use second option to redirect. I know ...
4
votes
2answers
104 views

How do I pass a list of files to grep

I am using find and getting a list of files I want to grep through. How do I pipe that list to grep?
1
vote
2answers
29 views

In tcsh how can I prepend 'cd ' to the output of a pipe?

As in, say I execute pwd to return the current directory and want to dump this in a script file so that I can come back, but I then need to prefix it with 'cd '?
1
vote
2answers
55 views

How to feed the results of date command into grep to filter results of another command

I need to use the result of a formatted date command (date +"%m/%d") as the grep filter to filter the results of another command that will display alerts on a system so that I only see alerts from the ...
9
votes
3answers
212 views

How to understand pipes

When I just used pipe in bash, I didn't think more about this. But when I read some C code example using system call pipe() together with fork(), I wonder how to understand pipes, including both ...
5
votes
2answers
78 views

Piping output from a segfaulting program

I have a script that calls a program (specifically, ttf2afm, part of tetex 3.0) that sometimes segfaults and sometimes doesn't. The information I need is always printed out before it segfaults, but ...
2
votes
2answers
77 views

Performance difference between stdin and command line argument

For some commands, it is possible to specify certain input as either stdin or a command line argument. Specifically, suppose command can take stdin input and a filename as command line argument, and ...

1 2 3 4
15 30 50 per page