This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdio.h> | |
#include <limits.h> | |
typedef struct rtunion { | |
char whatever[8]; | |
} rtunion; | |
int main (int argc, char **argv) { | |
(void)argc; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find directories which contain only one entry called "index.html" and delete them | |
# this doesn't enforce that the found "index.html" is a file rather than a directory, symlink, socket, device node, etc | |
find . -depth -print0 | \ | |
awk 'BEGIN{RS="\0";ORS="\0";} match($0, /^(.*)[/]([^/]+)$/, A) {prevDir=dir; dir=A[1]; if ((prevDir == $0) && couldDelete) { print($0); } if (prevDir != dir) { couldDelete = 1; } if (A[2] != "index.html") { couldDelete = 0; } }' | \ | |
xargs -0 rm -r |
OlderNewer