#!/usr/bin/env perl
|
|
|
|
=pod
|
|
|
|
=head1 NAME
|
|
|
|
marks-each - execute some command for each marked file
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
marks-each execute a command for each marked file
|
|
|
|
USAGE:
|
|
marks each command
|
|
|
|
EXAMPLE:
|
|
marks foo.txt bar.txt
|
|
marks each wc -l
|
|
|
|
=head1 AUTHOR
|
|
|
|
Brennen Bearnes
|
|
|
|
=cut
|
|
|
|
use strict;
|
|
use warnings;
|
|
use 5.10.0;
|
|
|
|
use App::MarkFiles qw(each_path);
|
|
use Pod::Usage;
|
|
|
|
if ( $ARGV[0] =~ m/^(-h|--help)$/ ) {
|
|
shift @ARGV;
|
|
pod2usage(0);
|
|
}
|
|
|
|
my ($cmd) = join ' ', @ARGV;
|
|
|
|
each_path(sub {
|
|
my ($path) = @_;
|
|
print `$cmd "$path"`;
|
|
});
|