Revision 2659a2aa7ca8cf17cae05d119fc3caee0480ddd6 authored by Dr. Stephen Henson on 16 December 2013, 21:41:07 UTC, committed by Dr. Stephen Henson on 16 December 2013, 21:41:07 UTC
1 parent 200f249
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 ...