Quote (Eep @ Jan 29 2013 09:54pm)
but you couldn't, say, pipe a pattern for grep to search for?
no. go read the man page for grep `man grep` it clearly says that if a file is not specified after the pattern to search for it trys reading from stdin.
something tells me you dont know about the standard inputs and outputs and their file discriptors.
0 stdin
1 stdout
2 stderr
any program that launches (including bash and everything else) always open 3 file discriptors at run time without you knowing. they are 0, 1, 2. these are kind of "links" that if you write any data to them they will appear to the screen or otherwise.
for example create a simple
Code
int main()
{
char str[10] = "testing";
fputs(str, 1);
return 0;
}
will output "testing" to your screen.
although in C and C++ there are defined macros for these file descriptors so if you see any weird things like that which is non stnadard (people use cerr, cout, cin) they will most likely sue the defines STDOUT, STDERR, and STDIN.
edit:: overall | takes stdout (1) and feeds it to stdin (0) of another running application.
This post was edited by AbDuCt on Jan 29 2013 08:07pm