Re: Useful use of cat
- From: Michael Tosch <eedmit@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 05 Jan 2006 20:28:05 +0100
Henry Townsend wrote:
Kevin Collins wrote:
In article <z96dnY3d37YLDyHeRVn-jQ@xxxxxxxxxxx>, Henry Townsend wrote:
Darren Dunham wrote:
The last one on that page (not posted in your list) is the most common for me. Using cat to hand a pipe rather than a file to a non-largefile aware filter:
% gzip <largefile> vs % cat <largefile> | gzip
You presumably meant to contrast with:
% gzip < <largefile>
as we all know there's a significant difference between "cmd file" and "cmd < file".
Actually, I don't think he did, although that will probably also work around
gzip's largefile limitation.
Possibly. There are three programs potentially involved here (cat, gzip, and the shell). Thus "gzip largefile" will fail if gzip doesn't know how to open large files[*], "gzip <largefile" will fail _only_ if the shell doesn't know how to open large files, and "cat largefile | gzip" will only help if both gzip and your shell are broken and cat is not. I'd be interested to see a system where this is the case. I can believe (versions of) gzip being broken for large files but have trouble imagining a system where cat had been fixed up and the shells hadn't. Not to mention that if your shell can't handle large files, where are you going to write the gzip/zcat output to?
[*] Basically a matter of passing O_LARGEFILE to open().
So true! The answer to your question can only be:
cat largefile | gzip | dd of=largefile.gz
provided that dd is largefile capable.
-- Michael Tosch @ hp : com .
- Follow-Ups:
- Re: Useful use of cat
- From: Sven Mascheck
- Re: Useful use of cat
- References:
- Re: Useful use of cat
- From: Henry Townsend
- Re: Useful use of cat
- Prev by Date: Re: how to edit only one paragraph
- Next by Date: Script endlessly looping
- Previous by thread: Re: Useful use of cat
- Next by thread: Re: Useful use of cat
- Index(es):
Relevant Pages
|