Hello,
On Wed, 30 Jan 2019, Laurence Perkins wrote:
>for VIDEO in $(find . -xtype f -iname '*.mp4' -o -iname '*.avi'\
> -o -iname '*.mkv'); do
> #Things in $() get run and their stdout gets stuffed into the
> #command line at that point. ${} is how you insert variable values.
> echo "${VIDEO},$(exiftool -T -ImageSize '${VIDEO}')"
>done
====
#!/usr/bin/perl -w
use strict;
use File::Find;
use Image::ExifTool;
use Encode;
my $exifTool = new Image::ExifTool;
sub wanted {
if( -f $_ && $_ =~ /^.*\.(?:mp4|mkv|avi)\z/si ) {
my $ii = $exifTool->ImageInfo($File::Find::name);
printf("%s,%s\n", $File::Find::name,
Encode::decode_utf8($ii->{ImageSize}) );
}
}
scalar @ARGV || push(@ARGV, '.');
File::Find::find({wanted => \&wanted, no_chdir => 1}, @ARGV );
====
Usage: $script [FILES_OR_DIRS...]
HTH,
-dnh
--
>> This needs quotes:
>> use lib "/path/to/perl/modules";
> Single or double quotes?
Yes. -- Tad McClellan in comp.lang.perl.misc