<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><br><br><div>> Date: Sun, 23 Mar 2014 13:59:54 +0100<br>> From: clemens@ladisch.de<br>> To: dj_kaza@hotmail.com<br>> CC: linux-audio-user@lists.linuxaudio.org<br>> Subject: Re: [LAU] Basic Bash/Find and batch CLI questions.<br>> <br>> Kaza Kore wrote:<br>> > find ./ -type d -exec ~/bin/flac2mp3 "{}" \;<br>> ><br>> > So find is passing all directories, via the type argument<br>> <br>> The type argument is a filter.<br><br>Yep got that much. Filter for Directories.<br><br>> > find is not actually being used for any searching, just to recursively send all folders, right?<br>> <br>> The default action is to print what has been found.<br><br>But there is no search term. Therefore I take it it's an assumed -name *.* and passes all directory paths (but no filenames) to the executed file.<br><br>> With -exec, the specified program is executed for each found item.<br><br>Each found item? So I could use [-type f -iname *.flac] and it would run through on each file in turn? (Been meaning to test this out, which is what I was trying when I came across the problem answered below. Not had a chance again yet. Obviously I'd have to at least remove the [cd "${1}" && for f in *.flac; do] section but replace it with what? Are programs such as ffmpeg and lame not designed to accept a list of files? I thought many Linux programs were designed to accept exactly this as input...<br><br>I'll try and do some experimenting after dinner. At least if my headache goes a bit...<br><br>> <br>> > I don't understand the bit after the exec call<br>> <br>> {} is the file name, ; ends the command to be executed.<br>><br><br>Thanks. That's pretty much the conclusions I had come to. Although still need to read up on bash again as how this then relates to $f etc still confused me a bit...<br><br>> > $ find -iname *wey*<br>> > find: paths must precede expression: weyheyhey !! - Little Batty Foo Foo (ft. TechDiff's Modest Loft Conversion remix).mp3<br>> <br>> The shell expands *wey* into multiple arguments, but -iname expects only one.<br>> It worked in the parent directory because *wey* could not be expanded there.<br>> <br>> To prevent expansion, quote it:<br>> <br>>   $ find . -iname '*wey*'<br>> <br><br>Still not sure while it baulks with *wey* and not with *wan* but thanks both you and James, using quotation marks cured that problem when testing earlier so all is good on that front.<br><br>I do agree having a single call to the script and the search-term (find command) being included in that would make sense, rather than having it called the method I currently am. Pretty sure most CLI commands can be used in bash but again the small bits I once learn have been lost to me currently, so more reading and testing needed!<br><br>And thanks other James, will look into mp3gain, it's also the first solution I found with Google. I know the subject of RMS normalisation has come up on here a few times so should probably spend some time searching the archives for this mail-list for that one (part of the reason I felt a little cheeky asking but as I had other questions too... ;) )<br><br>Dale.<br></div>                                    </div></body>
</html>