On Monday July 27 2009, Zhang Weiwu wrote:
Hi. I haven't been using commandline extensively for some years, and when I come back to Linux, I was surprised to see GUI software being developed so fast and so well on Linux (and feel happy about it). However I wonder if current commandlin isn't as useful as was.
...
Another example: when I wanted to join multiple TIFF images into a single multi-page tiff image, I thought I could do this:
$ tiffcat < page-1.tiff page-2.tiff page-3.tiff page-4.tiff > pages.tiff
I'm not sure what this is supposed to do or what you imagine it does, but if you think that tiffcat is getting the contents of page-2.tiff through page-4.tiff, you're mistaken. File redirection in the shell only operates on a single file. Further, and many people don't realize this, file redirection (but not piping) can appear anywhere in the command and need not be at the end or the beginning. If in the preceding command line you want tiffcat to read the contents of all four TIFF files on its standard input, this will work: % cat page-{1,2,3,4}.tiff |tiffcat If tiffcat, e.g., accepts only a single named argument and will not read its standard input, this will work: % tiffcat <( cat page{1,2,3,4}.tiff ) This syntax, <( command ), makes the output of "command" appear as a named file argument (but is actually a named pipe). Note that for some programs (kdiff3 and Vim are two I know of) this won't work because the program wants to read the input more than once (i.e., it wants to seek within the file, which pipes do not support), so if you get odd behavior when using this construct, that can be the reason. Because of this, I wrote a wrapper that I can use when a random-access file is required and I want to use the <( ... ) notation.
...
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org