From owner-freebsd-questions@freebsd.org Sat Jan 6 12:12:03 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C28EEB676E for ; Sat, 6 Jan 2018 12:12:03 +0000 (UTC) (envelope-from gmx@ross.cx) Received: from www81.your-server.de (www81.your-server.de [213.133.104.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D89A36B4CF for ; Sat, 6 Jan 2018 12:12:02 +0000 (UTC) (envelope-from gmx@ross.cx) Received: from [90.187.37.173] (helo=workstation) by www81.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES128-GCM-SHA256:128) (Exim 4.85_2) (envelope-from ) id 1eXmu9-000209-Sw; Sat, 06 Jan 2018 12:44:50 +0100 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: Polytropon , "Victor Sudakov" Cc: freebsd-questions@freebsd.org Subject: Re: Convert .flac and .ape to mp3 References: <20180104163421.GA15692@admin.sibptus.transneft.ru> <20180104175156.440fa0c2.freebsd@edvax.de> <20180106063934.GA32231@admin.sibptus.transneft.ru> Date: Sat, 06 Jan 2018 12:44:40 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Michael Ross" Message-ID: In-Reply-To: <20180106063934.GA32231@admin.sibptus.transneft.ru> User-Agent: Opera Mail/1.0 (Win32) X-Authenticated-Sender: gmx@ross.cx X-Virus-Scanned: Clear (ClamAV 0.99.2/24196/Sat Jan 6 06:13:56 2018) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jan 2018 12:12:03 -0000 Am .01.2018, 07:39 Uhr, schrieb Victor Sudakov : > So eventually I will need to write a script to process all the *.ape > files, probably with bchunk. Which brings the following question. If > the file and directory names have spaces in them, a simple loop like > this: > > #!/bin/sh > for i in `find . -iname '*.ape'` > do > do_something $i > done > > breaks on spaces. > > What is the sh magic to handle such filenames? > xargs, you may want to run a few conversions in parallel: find . -iname '*.ape' -print0 | xargs -0 -I% -P convert % %.mp3 -- Michael