wan_jm writes:
>    I have another questions on posix_spawnp then; there are following code in 
> it.
> I want to know why when there is format error, the code still try to use 
> /bin/sh to execute it. it the code was written in perl or something else, it 
> will gives error result. So I think there is no need to do this.

The code you're looking at handles the case where there's an
executable file that's not in any known format -- ENOEXEC means that
it isn't in an known binary format (such as ELF) and that it doesn't
start with "#!" to specify an interpreter.

In those cases, the standards specify that we have to execute such
files using the default shell, and that's what the code does.  This
feature allows you to do stuff like:

        echo "foo bar" > blah
        chmod +x blah
        ./blah

... and have it execute "foo" with argument "bar" as expected, even
though the "blah" file doesn't specify any particular interpreter to
use.

I'm not sure I understand what it would have to do with the problem
you've encountered with $EDITOR.  It seems unrelated to me.

-- 
James Carlson, Solaris Networking              <[email protected]>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to