/* Will delete anything given as an argument (if the file exists) * * Made because files starting with a bunch of --- tend to mess up * files taking command line options. * * Public domain! */ #include #include int main(int argc, char * argv[]) { int i; if(argc < 2) { printf("Usage: %s [] ... \n", argv[0]); return 1; } for(i = 1; i < argc; i++) { printf("Deleting file: %s\n", argv[i]); if(unlink(argv[i]) == -1) { printf("Could not delete \"%s\": ", argv[i]); fflush(stdout); perror(""); } } return 0; }