From: Dennis Haney <davh@davh.dk>
To: zsh-users@sunsite.dk
Subject: Re: tar bzip
Date: 23 Feb 2003 15:42:25 +0100 [thread overview]
Message-ID: <87ptpjqcry.fsf@cine.davh.dk> (raw)
In-Reply-To: <1030223015556.ZM11499@candle.brasslantern.com>
>>>>> "Bart" == Bart Schaefer <schaefer@brasslantern.com> writes:
Bart: On Feb 23, 2:41am, Dennis Haney wrote:
Bart: }
Bart: } xvzf is in my fingers and I keep forgetting it every time I untar a
Bart: } bzip file, so:
Bart: }
Bart: } How is it possible to get tar xvzf something.tbz (or
Bart: } something.tar.bz2) to convert the z (in xvzf) to a j?
Bart: Possibly this:
Bart: function tar {
Bart: integer i=1
Bart: while (( i < ARGC ))
Bart: do
Bart: if [[ $argv[i] == (x*v|v*x)*f && $argv[i] == *z* &&
Bart: $argv[i+1] == *.(t|)bz(|2) ]]
Bart: argv[i]=${argv[i]:s/z/j}
Bart: break
Bart: fi
Bart: done
Bart: command tar $*
Bart: }
Thank you very much. This does the job just fine:
function tar {
if [[ $argv[1] == xvzf && $argv[2] == *.(t|tar.)bz(|2) ]]
argv[1]=${argv[1]:s/z/j/}
command tar $*
}
Bart: The problem of course is that something like xvzbf is followed first by
Bart: a blocksize and then by a file name, so without creating a full-blown
Bart: tar option parser you really can't do a perfect job.
Thats ok, I was just interested in this one specific case.
--
Dennis
use Inline C => qq{void p(char*g){
printf("Just Another %s Hacker\n",g);}};p("Perl");
prev parent reply other threads:[~2003-02-23 14:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-23 1:41 Dennis Haney
2003-02-23 1:52 ` William Park
2003-02-23 1:55 ` Bart Schaefer
2003-02-23 14:42 ` Dennis Haney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ptpjqcry.fsf@cine.davh.dk \
--to=davh@davh.dk \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).