Article View: comp.os.msdos.programmer
Article #6163Re: Normal MSDOS multitasking!
From: Alex Liu
Date: Tue, 22 Dec 1992 18:13
Date: Tue, 22 Dec 1992 18:13
47 lines
3107 bytes
3107 bytes
Hi, I think what some people are missing is what is the idea of pipes. Under Unix, the concept of Pipes comes from the idea of linking small prewritten utilities to get something done as opposed to writing a entirely new application. For example, let say, I want to display all the files in a UNIX directory that were created on a certain date, I also want to only display the filenames and in reverse sort order in columns. One way to do it under Unix is: ls -l | grep 'Aug 12 1990' | cut -c65- | sort -r | pr -t -4 (This is an example. May not work exactly right, but it will with some tweaking depending on the version of Unix you are using) Now, doing something like that, as cryptic and complicated that it might look to the uninitated, it is MUCH MUCH better than writing a "ls" (or DIR) program that will do EVERYTHING under the sun. You will be asking by now, what does this have to do with MS-DOS pipes? Well, this is just to illustrate a point. A previous poster was arguing that doing: zcat file.tar.Z | tar tvf - | grep foo is bad design, because you shouldn't have to do a compress just to find a file. But the point is that when they designed zcat/compress and tar, it was to be modular. compress is a generic file compressor, that you could use with any utility. The fact that you have pipes allows you to use compress without having to write your own LZW compression routines. unzip -v file.zip foo*.* Doing that, for you is fine, but it is not necessarily better. It is just a different way to do things. One could argue for example, that unzip is a more complicated program than any of the unix equivalents, and at the same token not as flexible. For example, the 3 previous commands, you can also grep for files of certain size, certain date, etc. By adding an extra command you could also sort them in reverse order or by size, etc. If unzip was to accomplish all that flexibility, that would make the program much bigger. If later, someone invents a new algorighm to make 1000:1 compression, you could still use tar, just replace zcat with your new compression program, but you will have to modify unzip (or wait until PKWare makes a new version). -- _____________________________________________________________________________ Alejandro Liu |EMail: aliu@usc.edu |All mispellings are intentional 1551A Ridgecrest Apt A |Voice: 213-264-9400 |Anything mentioned here is not Monterrey Park, CA91754 | |necessarily true.
Technical Details
Message-ID:
<1h7lrmINNpde@aludra.usc.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!chaph.usc.edu!aludra.usc.edu!not-for-mailReferences:
<1ghb1vINNccb@ub.d.umn.edu> <9212142475@fcshome.UUCP> <dmurdoch.363.724430472@mast.queensu.ca> <1992Dec15.202449.28162@rd.hydro.on.ca> <dmurdoch.365.724454682@mast.queensu.ca> <1992Dec22.003509.8929@rd.hydro.on.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!chaph.usc.edu!aludra.usc.edu!not-for-mail From: aliu@aludra.usc.edu (Alex Liu) Newsgroups: comp.os.msdos.programmer Subject: Re: Normal MSDOS multitasking! Date: 22 Dec 1992 10:13:10 -0800 Organization: None to Speak of Lines: 47 Message-ID: <1h7lrmINNpde@aludra.usc.edu> References: <1ghb1vINNccb@ub.d.umn.edu> <9212142475@fcshome.UUCP> <dmurdoch.363.724430472@mast.queensu.ca> <1992Dec15.202449.28162@rd.hydro.on.ca> <dmurdoch.365.724454682@mast.queensu.ca> <1992Dec22.003509.8929@rd.hydro.on.ca> NNTP-Posting-Host: aludra.usc.edu