From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19901 invoked by alias); 12 Feb 2014 02:17:45 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18423 Received: (qmail 4644 invoked from network); 12 Feb 2014 02:17:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Jan Larres Subject: Re: executing commands in directories containing specific files Date: Wed, 12 Feb 2014 15:17:21 +1300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: yass.opencloud.co.nz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: On 12/02/14 14:17, Philip Dexter wrote: > On Tue, Feb 11, 2014 at 7:35 PM, Jan Larres wrote: >> On 12/02/14 13:11, Leonardo Barbosa wrote: >>> I'd like to find TeX files (find $HOME -type f -name '*.tex'). Let's say i >>> have found files a.tex, b.tex, and c.tex. Now, i wanna remove a.aux, b.aux, >>> c.aux. What's the best way of doing that? >> >> find $HOME -type f -name '*.tex' -exec rm {} \; >> > That won't get the aux files Oh, whoops. I missed the differing extensions. In that case your solution is probably best, except without removing the tex files themselves: for f in $HOME/**/*.tex; do rm ${f:r}.aux; done Jan