micro-utils/coreutils/dirname.c

17 lines
227 B
C
Raw Normal View History

2023-10-24 13:59:42 +03:00
#include <stdio.h>
#include <libgen.h>
int main(const int argc, const char **argv) {
if (argc <= 1) {
printf("dirname [dirname]\n");
return 1;
}
for (int i = 1; i < argc; i++)
puts(dirname(argv[i]));
return 0;
}