Revision 9bd2dde42f59d60dfec149a28f8c91b6fb2cf717 authored by Dr. Stephen Henson on 25 November 2011, 16:27:19 UTC, committed by Dr. Stephen Henson on 25 November 2011, 16:27:19 UTC
1 parent 31bf5f1
dirname.pl
#!/usr/local/bin/perl
if ($#ARGV < 0) {
die "dirname.pl: too few arguments\n";
} elsif ($#ARGV > 0) {
die "dirname.pl: too many arguments\n";
}
my $d = $ARGV[0];
if ($d =~ m|.*/.*|) {
$d =~ s|/[^/]*$||;
} else {
$d = ".";
}
print $d,"\n";
exit(0);

Computing file changes ...