text
stringlengths
1
330k
If you want to pipe in sequence the output of multiple commands you can use one of the following forms:
(command1; command2) | command3
{ command1; command2; } | command3
but you can also use redirection on process substitution
command3 < <(command1; command2)
finally, if command3 accept a file parameter (in substitution od stdin)
command3 <(command1; command2)
share|improve this answer
add comment
If a command takes a list of files as arguments and processes those files as input (or output, but not commonly), each of those files can be a named pipe or /dev/fd pseudo-file provided transparently by process subsitution:
$ sort -m <(command1) <(command2) <(command3)
This will "pipe" the output of the three commands to sort, as sort can take a list of input files on the command line.
share|improve this answer
IIRC the <(command) syntax is a bash-only feature. –  Philomath Jul 21 '11 at 8:23
@Philomath: It's in ZSH too. –  Caleb Jul 21 '11 at 9:37
Well, ZSH has everything... (or at-least tries to). –  Philomath Jul 21 '11 at 9:54
@Philomath: How is process substitution implemented in other shells? –  camh Jul 21 '11 at 12:23
@Philomath <(), like many advanced shell features, was originally a ksh feature and was adopted by bash and zsh. psub is specifically a fish feature, nothing to do with POSIX. –  Gilles Jul 21 '11 at 16:23
show 2 more comments
Here are three things you can do with process substitution that are impossible otherwise.
Multiple process inputs
diff <(cd /foo/bar/; ls) <(cd /foo/baz; ls)
There simply is no way to do this with pipes.
Preserving STDIN
Say you have the following:
curl -o - http://example.com/script.sh
read LINE
echo "You said ${LINE}!"
And you want to run it directly. The following fails miserably. Bash is already using STDIN to read the script, so other input is impossible.
curl -o - http://example.com/script.sh | bash
But this way works perfectly.
bash <(curl -o - http://example.com/script.sh)
Outbound process substitution
Also note that process substitution works the other way too. So you can do something like this:
(ls /proc/*/exe >/dev/null) 2> >(sed -n \
'/Permission denied/ s/.*\(\/proc.*\):.*/\1/p' > denied.txt )
That's a bit of a convoluted example, but it sends stdout to /dev/null, while piping stderr to a sed script to extract the names of the files for which a "Permission denied" error was displayed, and then sends THOSE results to a file.
Note that the first command and the stdout redirection is in parentheses (subshell) so that only the result of THAT commend gets sent to /dev/null and it doesn't mess with the rest of the line.
share|improve this answer
add comment
Your Answer
Why would you want to be someone else
When you could be better by being yourself
Why pretend to be someone you are not
When you have something they haven't got
Cheating yourself of the life you have to live
Deprives others of that only which you can give
You have much more to offer by being just you
Than walking around in someone else's shoes
Trying to live the life of another is a mistake
It is a masquerade; nothing more than a fake
Be yourself and let your qualities show through
Others will love you more for being just you
Remember that God loves you just as you are
To Him you are already a bright shining star
Family and friends will love you more too
If you spent time practicing just being you
by Ellen Bailey
post #1 of 1
Thread Starter 
You know them, those are the cans that make your records sound great in the store and like crap at home. I have tried to find who makes them and so far the answer is a "we are not allowed to identify our distribuitors". Here in Mexico the main chain that uses them is the Mixup record stores. You can find them at HMV in...
Mars Exploration Rover Launch Press Kit
Document Sample
scope of work template
Mars Exploration
Rover Launches
Press Kit
June 2003
Media Contacts
Donald Savage Policy/Program Management 202/358-1547
Washington, D.C.
Guy Webster Mars Exploration Rover Mission 818/354-5011
Jet Propulsion Laboratory,
Pasadena, Calif.
David Brand Science Payload 607/255-3651
Cornell University,
Ithaca, N.Y.
George Diller Launch 321/867-2468
Kennedy Space Center, Fla.
Where We've Been and Where We're Going …………………………………................ 14
NASA's Mars Exploration Rover project kicks off by launching the first of two unique
robotic geologists, as early as June 8. The identical rolling rovers see sharper images,
can explore farther and examine rocks better than anything that's ever landed on Mars.
The second rover mission, bound for a different site on Mars, will launch as soon as
June 25.
"The instrumentation onboard these rovers, combined with their great mobility, will offer
a totally new view of Mars, including a microscopic view inside rocks for the first time,"
said Dr. Ed Weiler, associate administrator for space science, NASA Headquarters,
"However, missions to Mars have proven to be far more hazardous than missions to
other planets. Historically, two out of three missions, from all countries who have tried
to land on Mars, ended in failure. We have done everything we can to ensure our
rovers have the best chance of success, and today I gave the order to proceed to
launch," Weiler said.
The first rover will arrive at Mars on Jan. 4, 2004, the second on Jan. 25. Plans call for
each to operate for at least three months. These missions continue NASA's quest to
understand the role of water on Mars. "We will be using the rovers to find rocks and
Weitz, Mars Exploration Rover program scientist at NASA Headquarters. "We'll analyze
First, the rovers have to safely reach Mars. "The rovers will use innovations to aid in
safe landings, but risks remain," said Peter Theisinger, Mars Exploration rover project
manager at NASA's Jet Propulsion Laboratory, Pasadena, Calif.