Date: Wed, 16 Jul 2008 19:17:22 -0700 From: Gary Kline <kline@thought.org> To: Giorgos Keramidas <keramida@ceid.upatras.gr> 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: <20080717021722.GC45384@thought.org> In-Reply-To: <8763r4q5wa.fsf@kobe.laptop> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 17, 2008 at 11:19:49AM +0300, Giorgos Keramidas wrote:
> 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 :-)
>
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080717021722.GC45384>
