What is the benefit of registering an extension via binfmt_misc?
#if 0
gcc "$0" -o "$@".out && exec ./"$@".out
#endif
#include <stdio.h>
int main () { printf ("hello, world\n"); return 0; }
Usage: $ chmod +x print.c
$ ./print.c
hello, world
(Could be better to use a temporary file though.)There's a similar cute trick for compiled OCaml scripts that we use with nbdkit: https://libguestfs.org/nbdkit-cc-plugin.3.html#Using-this-pl...
zx2c4•2h ago