|
Tom Liotta wrote:
To the *nix-heads: With all the back and forth that was going on over which command line is better, I'd like to ask a question about the piping and redirection on the *nix side of things. I'm familiar with the concepts, but I'm not clear on how the issue of non-streamfile manipulation would be handled by various *nix shells. That is, under QSHELL, I can pretty much pipe the output of one command into another just as I could under just about any other *nix shell. And if I don't have a particular utility, I can build my own or possibly port one so that I'll have the same utilities that are available elsewhere. Disregarding any fancy facilities some great shell might have beyond just piping and redirection, on other systems, how do basic commands/utilities such as sed and grep handle files that aren't streamfiles? That is, traditional OS/400 commands commonly wouldn't support something like piping because they generally rely on a database record format. Is it even meaningful to make comparisons outside of QSHELL?
Strictly speaking, in Unix everything is a stream file. It's up to particular programs and applications to assign specific meanings to the bytes that make up a file. And so, if you want to process certain types of files intelligently, you need specific application programs. For certain types of collections of data, like databases and images, processing that data using a stream model makes little sense. For example, you wouldn't want to use grep on a database file. Instead, you'd open an SQL command prompt and search the database using a SELECT statement. Likewise, if you wanted to scale an image file, you wouldn't use something like sed or perl, you'd use an X based image program, like the gimp, or a command line utility like ImageMagick. On the other hand, the stream model works very nicely for files involved with programming, such as program source files and scripts, make files, html documents, etc. Cheers! Hans (4 days to go before my LOA! :-)
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.