mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
19 lines
268 B
Perl
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);
|