Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!uunet!snorkelwacker!bloom-beacon!eru!hagbard!sunic!nuug!sigyn.idt.unit.no!news From: Harald.Eikrem@elab-runit.sintef.no Newsgroups: comp.unix.shell Subject: Re: Can U pipe filenames to rm??? Message-ID: <90Oct1032738*Harald.Eikrem@elab-runit.sintef.no> Date: 1 Oct 90 02:27:38 GMT References: <28790002@col.hp.com> Sender: news@idt.unit.no (Usenet news admin) Organization: ELAB-RUNIT (SINTEF), Trondheim, Norway. Lines: 20 Now, long before xargs I used this little simple utility: --Harald E /* rmf.c - Removes files according to contents of file arg or stdin */ #include int errno; main(ac,av) char **av; { char filen[BUFSIZ]; if (ac > 1 && freopen(av[1], "r", stdin) == NULL) { perror(av[1]); fprintf(stderr, "usage: %s [ list-file ]\n\ Removes files according to contents of list-file (or standard input)\n\ one file per input line.\n", av[0]); exit(1); } while (gets(filen)) if (unlink(filen) != 0) perror(filen); }