Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: tar bzip
- X-seq: zsh-users 5937
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Dennis Haney <davh@xxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: Re: tar bzip
- Date: Sun, 23 Feb 2003 01:55:55 +0000
- In-reply-to: <87lm073h95.fsf@xxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <87lm073h95.fsf@xxxxxxxxxxxx>
On Feb 23, 2:41am, Dennis Haney wrote:
}
} xvzf is in my fingers and I keep forgetting it every time I untar a
} bzip file, so:
}
} How is it possible to get tar xvzf something.tbz (or
} something.tar.bz2) to convert the z (in xvzf) to a j?
Possibly this:
function tar {
integer i=1
while (( i < ARGC ))
do
if [[ $argv[i] == (x*v|v*x)*f && $argv[i] == *z* &&
$argv[i+1] == *.(t|)bz(|2) ]]
argv[i]=${argv[i]:s/z/j}
break
fi
done
command tar $*
}
The problem of course is that something like xvzbf is followed first by
a blocksize and then by a file name, so without creating a full-blown
tar option parser you really can't do a perfect job.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author