micro-utils/coreutils/dirname.c
2023-10-24 15:36:13 +03:00

17 lines
221 B
C

#include <stdio.h>
#include <libgen.h>
int main(const int argc, char **argv) {
if (argc <= 1) {
printf("dirname [dirname]\n");
return 1;
}
for (int i = 1; i < argc; i++)
puts(dirname(argv[i]));
return 0;
}