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

From: Clemens Ladisch <clemens@email-addr-hidden>
Date: Sun Mar 23 2014 - 14:59:54 EET

Kaza Kore wrote:
> find ./ -type d -exec ~/bin/flac2mp3 "{}" \;
>
> So find is passing all directories, via the type argument

The type argument is a filter.

> find is not actually being used for any searching, just to recursively send all folders, right?

The default action is to print what has been found.
With -exec, the specified program is executed for each found item.

> I don't understand the bit after the exec call

{} is the file name, ; ends the command to be executed.

> $ find -iname *wey*
> find: paths must precede expression: weyheyhey !! - Little Batty Foo Foo (ft. TechDiff's Modest Loft Conversion remix).mp3

The shell expands *wey* into multiple arguments, but -iname expects only one.
It worked in the parent directory because *wey* could not be expanded there.

To prevent expansion, quote it:

  $ find . -iname '*wey*'

Regards,
Clemens
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Sun Mar 23 16:15:03 2014

This archive was generated by hypermail 2.1.8 : Sun Mar 23 2014 - 16:15:03 EET