[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gzip and gunzip should have -k (--keep) option like bzip2 and bunzip
From: |
Shriramana Sharma |
Subject: |
Re: gzip and gunzip should have -k (--keep) option like bzip2 and bunzip2 |
Date: |
Sun, 07 Jan 2007 16:11:48 +0530 |
User-agent: |
Thunderbird 1.5.0.8 (Windows/20061025) |
Bob Proulx wrote:
Hmm... Basic command line shell operation is not a trick. Input and
output file redirection is a fundamental operation of the command
line shell. Most users learn that '>' redirects the output of a
command to the file very early in their use of it.
Right. Now I have many gzipped files in a folder. How do I now gunzip
them all without destroying the gz files themselves? gunzip < *.gz
throws up an error saying "ambiguous redirect". It is evident that this
usage is straightforward, since I have to do one thing for a single file
and apparent another thing for many files.
I can't believe this is typical however. And now that you have
learned it you will have a new world of capability available to you.
OK thanks, but I still feel that this small addition would go a long way
to helping people using gzip. We should not force a new user into
learning < and > (especially when he/she is not used to the shell very
much) and whatever solution you are going to give me for the "ambiguous
redirect" up there just to do a small thing like zip or unzip files
without destroying the sources. Not all users will have the patience or
time to mail the list and get a reply. The -k option would really help
them.
See for example also, the tar command has the z and j options, whereas
the same work would be accomplished by tar -c | gzip and tar -c | bzip2.
Just because a more advanced alternative exists should not be a reason
not to provide a single simple alternative.
Just because something can be done does not mean that it should be
done. Duplicating code in multiple places can always be done but it
is almost always a bad idea to do so. It creates a maintenance
problem to keep the code in sync with each other.
Just adding a few lines to say: "if there is an argument -k then do not
delete the original files" would create a maintenance problem with
syncing? For big libraries and things like that duplication is a
problem, but not with two-line solutions like -k.
To avoid duplication of code and to provide consistency across
commands this functionality should be some place that is shared among
all of the commands.
Are you saying that -R for --recursive is implemented by the shell and
not commands like cp, chmod, chown individually? (All three use -R.)
Shriramana Sharma.