Nicholas Clark <[email protected]> writes:

> I offer you this software that I've only just written. I don't think that
> it's that hateful:
>
> $ cat goodbye_world.c 
> #include <stdio.h>
> #include <stdlib.h>
>
> int main(int argc, char **argv) {
>     puts("Goodbye world.");
>     return remove(argv[0]);
> }
> $ gcc -Wall -o goodbye_world goodbye_world.c 
> $ ./goodbye_world 
> Goodbye world.
> $ ./goodbye_world 
> bash: ./goodbye_world: No such file or directory
>
> [likely won't be usefully portable to any OS that forbids deleting
> open files, and keeps the files corresponding files open.]

Or when invoked via $PATH rather than with an explicit path.

-- 
ilmari
"A disappointingly low fraction of the human race is,
 at any given time, on fire." - Stig Sandbeck Mathisen

Reply via email to