Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Deleting files with two identical parts in filename
- X-seq: zsh-users 13004
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Deleting files with two identical parts in filename
- Date: Tue, 8 Jul 2008 14:26:58 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=vNKkj5LrsA34vy2Ac7Z6oiExsWBGmw3IpG83rTAYQkk=; b=netXyYhWnlCJtq9/eumoOVfitp8gn9M7bg/8S5vJTrvQ9PAQQwggR13f08I1z5hjOQ f8ylI/NNyrAEpqSVBC30zIYbYOo3UJ35NRJVeVuR7fERteLBQ35txlGpxUS6eO1IccEd YLaAghetjHxqbX4pbN9egGXNsRE3/1eAWmjaM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=GpntTA7eKq5BE1LW2wgvy6DTqrMpO3LYROy/KFElxYv3n0jsgs3QBt6z73R1Q6ZYTt G1Yzs5Sp1GM6m/ezAoi/M9qIAC+a3hkzdZK49I86G3Z8pbma3qInM2XXqlcyehLejep+ n9/dN3hR4YGlHyVddrO4IYYZjiGwtAU396qK8=
- In-reply-to: <20080708122115.GC4041@xxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20080708122115.GC4041@xxxxxxxxxxxx>
2008/7/8 Jens Kubieziel <maillist@xxxxxxxxxxxx>:
> Hi,
>
> in a directory there are some files:
> # ls
> abc.bar+bar abc.bar+foo abc.foo+bar abc.foo+baz abc.foo+foo
>
> I want to delete all files which have the same string before and after
> the '+' (abc.bar+bar and abc.foo+foo). Is there a way with zsh to do
> just 'rm $SOME_MAGIC_COMMAND', which does the job?
rm *(e:'[[ $REPLY = abc.(#b)(???)+(???) ]] && [[ $match[1] = $match[2] ]]':)
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author