From owner-freebsd-questions@FreeBSD.ORG Thu Jul 17 02:17:26 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 454141065677 for ; Thu, 17 Jul 2008 02:17:26 +0000 (UTC) (envelope-from kline@thought.org) Received: from aristotle.thought.org (ns1.thought.org [209.180.213.210]) by mx1.freebsd.org (Postfix) with ESMTP id EAC178FC1E for ; Thu, 17 Jul 2008 02:17:25 +0000 (UTC) (envelope-from kline@thought.org) Received: from thought.org (tao.thought.org [10.47.0.250]) (authenticated bits=0) by aristotle.thought.org (8.14.2/8.14.2) with ESMTP id m6H2HTqt091831; Wed, 16 Jul 2008 19:17:29 -0700 (PDT) (envelope-from kline@thought.org) Received: by thought.org (nbSMTP-1.00) for uid 1002 kline@thought.org; Wed, 16 Jul 2008 19:17:22 -0700 (PDT) Date: Wed, 16 Jul 2008 19:17:22 -0700 From: Gary Kline To: Giorgos Keramidas Message-ID: <20080717021722.GC45384@thought.org> References: <20080714201241.GA22443@thought.org> <20080715073651.P1638@wojtek.tensor.gdynia.pl> <20080715183500.GA76088@thought.org> <20080715190224.GC21840@Grumpy.DynDNS.org> <20080715215024.GA82902@thought.org> <8763r4q5wa.fsf@kobe.laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8763r4q5wa.fsf@kobe.laptop> User-Agent: Mutt/1.4.2.3i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 21++ years of service to the Unix community. X-Spam-Status: No, score=-4.4 required=3.6 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on aristotle.thought.org Cc: Wojciech Puchar , David Kelly , FreeBSD Mailing List Subject: Re: why is this script failing? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2008 02:17:26 -0000 On Thu, Jul 17, 2008 at 11:19:49AM +0300, Giorgos Keramidas wrote: > On Tue, 15 Jul 2008 14:50:24 -0700, Gary Kline wrote: > > thanks for this clarification! until yesterday, whe you mmentioned > > blanks[whitespace], as id a song title, i hadn't tought about songs > > like "Not Ready to Make Nice.ogg" e.g. I am not sure why these > > players store the song in wav format without deleting the files, but > > when my limited /tmp is full, certain aps fail mysteriously. with a > > fwdozen more line of code they could at least fail more gracefully. > > For those cases, we have find(1) and xargs(1): > > #!/bin/sh > find /var/tmp -name '*.wav' -exec rm '{}' \+ > > or > > #!/bin/sh > find /var/tmp -name '*.wav' -print0 | xargs -0 rm > > Whitespace handling _is_ important in shell scripts, but it is also a > good idea to entirely avoid having to handle with it when we can :-) > well, by jove--er, Zeus:). i never knew that find had a print0 option. it fputs the entire path, and then glues on the '\0' byte. thank you very much , Giorgos. gary PS: if a bunch of us ever get together and write a fbsd wiki, this has got to be in there! -- Gary Kline kline@thought.org www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org