[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: OT: Bash Scripting Question



How about this?

#! /usr/bin/perl -w
# $Id: ls-r-full,v 1.2 2005/04/09 06:15:43 dpchrist Exp $
# Copyright 2005 by David Christensen <dpchrist@holgerdanske.com>
# This script is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself, either Perl version 5.8.6 or,
# at your option, any later version of Perl 5 you may have available.

use strict;
use Data::Dumper;
use File::Find;
use File::Spec::Functions;
use Getopt::Long;
$| = 1;
our $debug;
GetOptions('debug|d' => \$debug);

sub process_file { print File::Spec->rel2abs($_), "\n"; }

print Data::Dumper->Dump([\@ARGV], [qw(*ARGV)]) if $debug;
my @dirlist = glob(join(' ', @ARGV));
print Data::Dumper->Dump([\@dirlist], [qw(*dirlist)]) if $debug;
find(\&process_file, @dirlist);


HTH,

David



Reply to: