Re: [LAU] Basic Bash/Find and batch CLI questions.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Cc: linux-audio-user@lists.linuxaudio.org <linux-audio-user@...>
Date: Sunday, March 23, 2014 - 1:50 pm

--_2c3419ca-e24c-41b6-8d68-5cb7d5c243ff_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

> Date: Sun=2C 23 Mar 2014 13:59:54 +0100

Yep got that much. Filter for Directories.

> > find is not actually being used for any searching=2C just to recursivel=
y send all folders=2C right?

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.

> With -exec=2C the specified program is executed for each found item.

Each found item? So I could use [-type f -iname *.flac] and it would run th=
rough on each file in turn? (Been meaning to test this out=2C which is what=
I was trying when I came across the problem answered below. Not had a chan=
ce again yet. Obviously I'd have to at least remove the [cd "${1}" && for f=
in *.flac=3B do] section but replace it with what? Are programs such as ff=
mpeg and lame not designed to accept a list of files? I thought many Linux =
programs were designed to accept exactly this as input...

I'll try and do some experimenting after dinner. At least if my headache go=
es a bit...

>=20

Thanks. That's pretty much the conclusions I had come to. Although still ne=
ed to read up on bash again as how this then relates to $f etc still confus=
ed me a bit...

> > $ find -iname *wey*

o (ft. TechDiff's Modest Loft Conversion remix).mp3
y one.
re.

Still not sure while it baulks with *wey* and not with *wan* but thanks bot=
h you and James=2C using quotation marks cured that problem when testing ea=
rlier so all is good on that front.

I do agree having a single call to the script and the search-term (find com=
mand) being included in that would make sense=2C rather than having it call=
ed 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=
=2C so more reading and testing needed!

And thanks other James=2C will look into mp3gain=2C it's also the first sol=
ution 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 ar=
chives for this mail-list for that one (part of the reason I felt a little =
cheeky asking but as I had other questions too... =3B) )

Dale.
=

--_2c3419ca-e24c-41b6-8d68-5cb7d5c243ff_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

&gt=3B Date: Sun=2C=
23 Mar 2014 13:59:54 +0100&gt=3B From: clemens@ladisch.de&gt=3B To=
: dj_kaza@hotmail.com&gt=3B CC: linux-audio-user@lists.linuxaudio.org&gt=3B Subject: Re: [LAU] Basic Bash/Find and batch CLI questions.&gt=
=3B &gt=3B Kaza Kore wrote:&gt=3B &gt=3B find ./ -type d -exec ~/bi=
n/flac2mp3 "{}" \=3B&gt=3B &gt=3B&gt=3B &gt=3B So find is passing a=
ll directories=2C via the type argument&gt=3B &gt=3B The type argum=
ent is a filter.Yep got that much. Filter for Directories.&=
gt=3B &gt=3B find is not actually being used for any searching=2C just to r=
ecursively send all folders=2C right?&gt=3B &gt=3B The default acti=
on is to print what has been found.But there is no search term. The=
refore I take it it's an assumed -name *.* and passes all directory paths (=
but no filenames) to the executed file.&gt=3B With -exec=2C the spe=
cified program is executed for each found item.Each found item? So =
I could use [-type f -iname *.flac] and it would run through on each file i=
n turn? (Been meaning to test this out=2C which is what I was trying when I=
came across the problem answered below. Not had a chance again yet. Obviou=
sly I'd have to at least remove the [cd "${1}" &amp=3B&amp=3B for f in *.fl=
ac=3B 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...I'll try and do so=
me experimenting after dinner. At least if my headache goes a bit...&gt=3B &gt=3B &gt=3B I don't understand the bit after the exec call&gt=3B &gt=3B {} is the file name=2C =3B ends the command to be execut=
ed.&gt=3BThanks. That's pretty much the conclusions I had come =
to. Although still need to read up on bash again as how this then relates t=
o $f etc still confused me a bit...&gt=3B &gt=3B $ find -iname *wey=
*&gt=3B &gt=3B find: paths must precede expression: weyheyhey !! - Litt=
le Batty Foo Foo (ft. TechDiff's Modest Loft Conversion remix).mp3&gt=
=3B &gt=3B The shell expands *wey* into multiple arguments=2C but -inam=
e expects only one.&gt=3B It worked in the parent directory because *we=
y* could not be expanded there.&gt=3B &gt=3B To prevent expansion=
=2C quote it:&gt=3B &gt=3B $ find . -iname '*wey*'&gt=3B =
Still not sure while it baulks with *wey* and not with *wan* but thanks=
both you and James=2C using quotation marks cured that problem when testin=
g earlier so all is good on that front.I do agree having a single c=
all to the script and the search-term (find command) being included in that=
would make sense=2C rather than having it called the method I currently am=
. Pretty sure most CLI commands can be used in bash but again the small bit=
s I once learn have been lost to me currently=2C so more reading and testin=
g needed!And thanks other James=2C will look into mp3gain=2C it's a=
lso the first solution I found with Google. I know the subject of RMS norma=
lisation 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... =3B) )Dale.
=

--_2c3419ca-e24c-41b6-8d68-5cb7d5c243ff_--

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAU] Basic Bash/Find and batch CLI questions., Kaza Kore, (Sun Mar 23, 6:25 am)
Re: [LAU] Basic Bash/Find and batch CLI questions., Clemens Ladisch, (Sun Mar 23, 1:00 pm)
Re: [LAU] Basic Bash/Find and batch CLI questions., Kaza Kore, (Sun Mar 23, 1:50 pm)
Re: [LAU] Basic Bash/Find and batch CLI questions., James Mckernon, (Sun Mar 23, 11:18 am)
Re: [LAU] Basic Bash/Find and batch CLI questions., James Morris, (Sun Mar 23, 10:19 am)