3 ms·
#! exit 42 bytes: 10 :D
by nanoscopic 7y ago
#!
exit 42
bytes: 10
:D
- saagarjha 7y agoYou don’t even need the #!, if the file doesn’t contain an interpreter at the top it’s automatically passed to /bin/sh.
- ptspts 7y agoYour suggestion doesn't work on Linux: $ echo 'exit 42' >xprog $ chmod 755 xprog $ python -c 'import os; os.execv("./xprog", ["./xprog"])'; echo $? Traceback (most recent call last): File "<string>", line 1, in <module> OSError: [Errno 8] Exec format error 1