3 ms·
Or for even more fun, self-modifying shell scripts: https://stackoverflow.com/questions/3398258/edit-shell-script-while-its-running https://stackoverflow.com/q
by userbinator 9y ago
Or 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.