On Jun 26, 2009, at 1:45 PM, Dagfinn Ilmari Mannsåker wrote:

Nicholas Clark <n...@ccl4.org> 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.

Or via symbolic link.

Josh


Reply via email to