Article View: comp.unix.shell
Article #1293Re: Can U pipe filenames to rm???
From: Harald.Eikrem
Date: Mon, 01 Oct 1990 02:27
Date: Mon, 01 Oct 1990 02:27
20 lines
1048 bytes
1048 bytes
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 <stdio.h>
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);
}
Technical Details
Message-ID:
<90Oct1032738*Harald.Eikrem@elab-runit.sintef.no>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!uunet!snorkelwacker!bloom-beacon!eru!hagbard!sunic!nuug!sigyn.idt.unit.no!newsReferences:
<28790002@col.hp.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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