From owner-freebsd-questions@freebsd.org Sat Jan 6 16:12:42 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 46406EBFFED for ; Sat, 6 Jan 2018 16:12:42 +0000 (UTC) (envelope-from andipersti@gmail.com) Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com [IPv6:2a00:1450:400c:c0c::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E04D274CED for ; Sat, 6 Jan 2018 16:12:41 +0000 (UTC) (envelope-from andipersti@gmail.com) Received: by mail-wr0-x22a.google.com with SMTP id o24so1423142wra.5 for ; Sat, 06 Jan 2018 08:12:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Q8YDR0XxUolrJaO38hWp77LmOCtlEpQmQ5zJqScH4NI=; b=Mp7cxy78XRvLol+koQBJxwYbBTsk2yvnycJJspX/FUO5fgBMOZ1xFtJWNGmOl7RhT9 Y6XanSFH8tVbwK/RGMWS2j90+exOlJybY8qdgE6VUH2VlFhnzZyb9IZTA8i0uslALds1 G7dFusdE+jSBPoaWCjdXcZo8MPn1bsVVwQUgzz1O1AwH2dW54Rn0AtCqhDEalSZy5/zF fSwChB2qtOAHm+7LuKg29TwO5P1zwFwr2NwGlAdRuMraaTKHTMVRy/lHiDgNtqpBambC PLwupKR0yJr3yaB6DrSfMCo7XfwgV1ne+4x+zhhRQ7mthe7MjBiVMOxhb/amrGJs4pRJ wVng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Q8YDR0XxUolrJaO38hWp77LmOCtlEpQmQ5zJqScH4NI=; b=VlQt74QR3AzoyAOr43HQET62vWqMNf2s8JNROB0a9tnombYxE+i2PkEYw7vTkWmLqd sheq5PP8N/aKF2r77XhaTYIkcHqRkByGbxV3kXSJW08GeQGbCeyb1/UTPtW+gFDFNiu1 YsWmhxcWaLjeXchiDSwT5r3OnnAHJSWDJkCSRZPSayorTNMqLScPMlbQiJNAL5aLWCYr iD/7O8NUHPBK5VPVp3SlF8TDM1TdEX/5DonUajlKCe8c+fHPsQkoYuQl58Ie+dRZVWgx c73duZMWQAovYxRW45tGLqCD7Jb+HidSCZ1Uju0ZIK1LzCvUBPH49Kw9Pgt6tYbxvmFm x75w== X-Gm-Message-State: AKGB3mIgAF1r+fQNoMZRX5F03tthl/IolAnpHHXlTCNQ6c2cna2EIdmO 808GAHsE2U8+r2cQsnxlIvI3Xw== X-Google-Smtp-Source: ACJfBovZKyjclPIfmBzz3lu7Fq3yQ5YU5Ot87ieHtgl+dv3tc4n0yu29wNjpzWgM+wESDsJB2zA5og== X-Received: by 10.223.159.7 with SMTP id l7mr5502699wrf.257.1515255159149; Sat, 06 Jan 2018 08:12:39 -0800 (PST) Received: from [192.168.178.25] (91-119-93-67.dsl.dynamic.surfer.at. [91.119.93.67]) by smtp.googlemail.com with ESMTPSA id 15sm11087244wrt.18.2018.01.06.08.12.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Jan 2018 08:12:38 -0800 (PST) Subject: Re: Convert .flac and .ape to mp3 To: freebsd-questions@freebsd.org References: <20180104163421.GA15692@admin.sibptus.transneft.ru> <20180104175156.440fa0c2.freebsd@edvax.de> <20180106063934.GA32231@admin.sibptus.transneft.ru> <20180106151754.GA35747@admin.sibptus.transneft.ru> From: Andreas Perstinger Message-ID: <06f10c10-8e39-ec9b-de84-0c345c8be229@gmail.com> Date: Sat, 6 Jan 2018 17:12:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180106151754.GA35747@admin.sibptus.transneft.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de_AT Content-Transfer-Encoding: 7bit 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 16:12:42 -0000 On 2018-01-06 16:17, Victor Sudakov wrote: > Michael Ross wrote: >> > #!/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 > > I'm sure there are many ways to solve the problem, including writing a > C program, but a solution in pure sh has its own value and appeal. Well, you use already the find command, so why don't you use it's full power? https://unix.stackexchange.com/questions/321697 (Why is looping over finds output bad practice?) Bye, Andreas