A utility to mark and operate on files in the shell.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 lines
552 B

#!/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"`;
});