Exactly so; "true" is the result of running such a file.
On Solaris, if you "truss" this then you'll see that this really runs under /sbin/sh and so this is the equivalent of /sbin/sh -c "" (unless that's an artifact of "truss"...)
On Linux, "strace" refuses with ENOEXEC, but under normal operation it still runs with a zero exit code.
Hmm -- leaning towards an artifact of truss there -- I'd be worried if the kernel made that decision, for some reason. What happens if you truss a noddy executable that just execs the empty file?
Comments 6
5/pvaneynd@sharrow:/tmp :) $ ls -l foo2
-rwxr-xr-x 1 pvaneynd pvaneynd 1 2009-08-15 10:05 foo2
5/pvaneynd@sharrow:/tmp :) $ ./foo2 && echo ok
ok
5/pvaneynd@sharrow:/tmp :) $
Reply
Reply
On Solaris, if you "truss" this then you'll see that this really runs under /sbin/sh and so this is the equivalent of /sbin/sh -c "" (unless that's an artifact of "truss"...)
On Linux, "strace" refuses with ENOEXEC, but under normal operation it still runs with a zero exit code.
Reply
Reply
Leave a comment