From owner-freebsd-questions@freebsd.org Sat Jan 6 09:34:54 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 89259EA4EF8 for ; Sat, 6 Jan 2018 09:34:54 +0000 (UTC) (envelope-from ultima1252@gmail.com) Received: from mail-yw0-x229.google.com (mail-yw0-x229.google.com [IPv6:2607:f8b0:4002:c05::229]) (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 48C337EB34 for ; Sat, 6 Jan 2018 09:34:54 +0000 (UTC) (envelope-from ultima1252@gmail.com) Received: by mail-yw0-x229.google.com with SMTP id q26so2648965ywa.6 for ; Sat, 06 Jan 2018 01:34:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MPvelf/oki4EvIgggHyXllk1nd0y0YfEJcS5BC3Yn94=; b=GdoEi7SCWEv4WSngv9sb7gPjz9xktYEgCkUI9+X0chBU3oQorfNBDb6haofbfafTBe T/l9DzriDcbPzapbhVQxRv2/HDV+G8JEsB/TL8BTGVW1+iCwWbISWR1mfGf1ZtePJ/fj OEVaAB0WyJ/q9v4uPr/BQVtbaHnhjtdJIUeCN30kvht1E8VpAKIz1OlcbsD/72+E/Ryh /EE8ZVtnWrZnzIe9TgBub5kz+u6oRqfVVoXR8+RYp955t8peZHm8x5zjv1vBYvxlduvN inbtT3Fl3tIWcXTkl3J5uiHp+kXQBu2iTfvU/mhC0aYRap1lIUFOyYnjzgz+1Bkd5uU5 zNNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MPvelf/oki4EvIgggHyXllk1nd0y0YfEJcS5BC3Yn94=; b=aVNInX7aSpZ65Iim4gtWZeLi3nUDP+7wo5vbRbR7/x4MuT9x5rCs/ujZtuYO95bvnv HDqeyAmaKXmxpT+/wc0D+j6HS1LhMBetzLy3btg8NT+TS6/jQUQNwcuI9dP9oN923o4H 1Y/O+a8k1zaO4PKBPq8Omm/tKVHo9DgYQvcqzux5YXSEC5aossSuI+guZcaofe8yl9ej a71DuxPW3jWwyW6vd6oLG4Cc7c8XicJplfILf6Yg1hP84ysUxQom+Fo3yMEScKaEo1UD aIekXcUtbTUjSQtVSGjza4HhDuK+nOwqO2x3LLKHhXZGzd51ypw/Vnd19mMcsSmfAPyo QduQ== X-Gm-Message-State: AKGB3mKPRLEB4bPsPA4YBx7MiG2zfCySnk2ARqmQZ1jdmj/O+OhZWI0e Ojq10M0r1n7GY1sBi0gBCnM2I8cob8EEriGqiBA= X-Google-Smtp-Source: ACJfBosisQZxCjagA6WbjttrNtptluSAn0Cp0zz1JcHTXFNacnoxXrwJIAtyi5jZnG229J+gsjlMmDui8ypHV723474= X-Received: by 10.129.122.215 with SMTP id v206mr5411408ywc.115.1515231293150; Sat, 06 Jan 2018 01:34:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.174.3 with HTTP; Sat, 6 Jan 2018 01:34:52 -0800 (PST) In-Reply-To: <20180106085528.GA33117@admin.sibptus.transneft.ru> References: <20180104163421.GA15692@admin.sibptus.transneft.ru> <20180104175156.440fa0c2.freebsd@edvax.de> <20180106063934.GA32231@admin.sibptus.transneft.ru> <20180106085528.GA33117@admin.sibptus.transneft.ru> From: Ultima Date: Sat, 6 Jan 2018 01:34:52 -0800 Message-ID: Subject: Re: Convert .flac and .ape to mp3 To: Victor Sudakov Cc: Polytropon , FreeBSD Mailing List Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 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 09:34:54 -0000 ah, yeah sorry I didn't understand the problem. find . -iname "*.ape" -exec echo \"{}\" \; This should be a solution. On Sat, Jan 6, 2018 at 12:55 AM, Victor Sudakov wrote: > Ultima wrote: > > > 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? > > > do_something "$i" > > Nope, these quotes make no difference, they are too late. > > The problem is in the "for " line, it cannot differentiate spaces _in_ > filenames and _between_ filenames. Look: > > $ touch "this is a long file name.ape" > $ ~/bin/ape2mp3.sh > + find . -iname '*.ape' > + echo ./this > ./this > + echo is > is > + echo a > a > + echo long > long > + echo file > file > + echo name.ape > name.ape > $ > > I'm sure the solution exists, it must be a very common case. > > > -- > Victor Sudakov, VAS4-RIPE, VAS47-RIPN > AS43859 >