1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-04 12:52:15 +00:00
freebsd/crypto/openssl/util/dirname.pl
2002-07-30 13:38:06 +00:00

19 lines
268 B
Perl

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