Revision 24fadf2a20f50d5623f61f2cc08f95c22b5ba75c authored by Dr. Stephen Henson on 03 January 2012, 19:43:06 UTC, committed by Dr. Stephen Henson on 03 January 2012, 19:43:06 UTC
1 parent 409abd2
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 ...