Results 1 to 10 of 11
Last year at the Linux show in NYC, I noticed that Microsoft had a nice tool. The guy demonstrated all these things from cmd.exe and one of them was the ...
- 11-02-2004 #1Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
Piping on cmd.exe
Last year at the Linux show in NYC, I noticed that Microsoft had a nice tool. The guy demonstrated all these things from cmd.exe and one of them was the ability to use the pipe.
Does anyone know what this product is? I know I can install cygwin but I'm curious to know what this product is called.The best things in life are free.
- 11-02-2004 #2Linux Guru
- Join Date
- Mar 2003
- Location
- Wisconsin
- Posts
- 1,907
Pipe, in Linux, is the ablity to use the output of one command as the input to another through the use of what's called a pipe. The pipe operator is | (shft + \). As an example, the cat command displays the contents of a file. Lets say file test contains the values 1,2,3,4 on seperate lines.
Would outputCode:cat test
1
2
3
4
The command grep pattern filename searches for pattern in filename. You can put the two together using a pipe.
will search the output of cat for the pattern 3. This example may seem lame, but consider searching the contents of /var/log/Xorg.0.log for errors. There may be hundreds of lines in the log. If there was an error, the line starts EE and lists the error.Code:cat test | grep 3
Will print only the errors.Code:cat /var/log/Xorg.0.log | grep EE
Hope that helps,
JeremyRegistered Linux user #346571
"All The Dude ever wanted was his rug back" - The Dude
- 11-02-2004 #3
jeremy1701,
i think bpark was asking how to get pipes working on windows.
if that's your question: you can use pipes on cmd.exe without any additional software. piping and subdirectories were two things that ms-dos "borrowed" from UNIX.
-lakerdonald
- 11-02-2004 #4Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
Ahh, I see.
I forgot that cmd.exe has redirection including the functionality of piping.
I guess the only thing then would be to install cygwin and edit the path env for those additional programs.The best things in life are free.
- 11-02-2004 #5
wait what? why would you need to edit stuff? piping is part of the DOS shell to the core
- 11-02-2004 #6
let me thingk, the so called pipe line rediercting ad modum BigCorp is eitehr terrible broken or just a bad implementation... iirc, winDOS only supports (parts of) the most rudamentary redirection:
'>', '>>' and '|' ('2>' or something like that *should* work, but I nerver got it to work in windos... )Regards Scienitca (registered user #335819 - http://counter.li.org )
--
A master is nothing more than a student who knows something of which he can teach to other students.
- 11-02-2004 #7
i never got what 2> did...
- 11-02-2004 #8Linux Engineer
- Join Date
- Sep 2003
- Location
- Knoxhell, TN
- Posts
- 1,078
it redirects a file descriptor...
Their code will be beautiful, even if their desks are buried in 3 feet of crap. - esr
- 11-02-2004 #9Linux User
- Join Date
- Jul 2004
- Posts
- 256
Originally Posted by lakerdonald 0 - standard inputCode:$ man bash
1 - standard output
2 - standard error output--monkey
- 11-02-2004 #10Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
Lakedonald:
After installing Cygwin, the PATH env variable in Windows needs to be edited to add the directory path to the newly installed Cygwin programs.
Piping is built into the shell. There's nothing you need to edit for this part.The best things in life are free.


Reply With Quote
