4 ms·
A really fun one is having `bash` execute its output using a FIFO. It worked when I tried it last, but it'd obviously be more than crazy to rely on it (for more
by repsilat 9y ago
A really fun one is having `bash` execute its output using a FIFO. It worked when I tried it last, but it'd obviously be more than crazy to rely on it (for more than one reason.)
- 13of40 9y agoReminds me of this old chestnut: type foo.bat >> foo.bat
- userbinator 9y agoOr for even more fun, self-modifying shell scripts: https://stackoverflow.com/questions/3398258/edit-shell-script-while-its-running https://stackoverflow.com/questions/3398258/edit-shell-scrip... (curiously, the accepted answer is incorrect and downvoted highly) ...and Windows batch files: https://stackoverflow.com/questions/906586/changing-a-batch-file-when-its-running https://stackoverflow.com/questions/906586/changing-a-batch-...
- jwbensley 9y agoSelf modifying code is wandering into the (very interesting IMO) realms of metamorphic and polymorphic code. I started an SO questionable here: https://stackoverflow.com/questions/10113254/metamorphic-code-examples https://stackoverflow.com/questions/10113254/metamorphic-cod... I'll try to find some time soon to port that C+inline assembly example to Linux, I didn't know much C or ASM back when I originally asked the question.