projects
/
oweals
/
openssl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
It makes more sense to refer to specific function manuals than the concept
[oweals/openssl.git]
/
util
/
dirname.pl
1
#!/usr/local/bin/perl
2
3
if ($#ARGV < 0) {
4
die "dirname.pl: too few arguments\n";
5
} elsif ($#ARGV > 0) {
6
die "dirname.pl: too many arguments\n";
7
}
8
9
my $d = $ARGV[0];
10
11
if ($d =~ m|.*/.*|) {
12
$d =~ s|/[^/]*$||;
13
} else {
14
$d = ".";
15
}
16
17
print $d,"\n";
18
exit(0);