Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jul 2008 11:19:49 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Gary Kline <kline@thought.org>
Cc:        Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl>, David Kelly <dkelly@hiwaay.net>, FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: why is this script failing?
Message-ID:  <8763r4q5wa.fsf@kobe.laptop>
In-Reply-To: <20080715215024.GA82902@thought.org> (Gary Kline's message of "Tue, 15 Jul 2008 14:50:24 -0700")
References:  <20080714201241.GA22443@thought.org> <20080715073651.P1638@wojtek.tensor.gdynia.pl> <20080715183500.GA76088@thought.org> <20080715190224.GC21840@Grumpy.DynDNS.org> <20080715215024.GA82902@thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 15 Jul 2008 14:50:24 -0700, Gary Kline <kline@thought.org> 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 :-)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8763r4q5wa.fsf>