lkml.org 
[lkml]   [2010]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: execve for script don't return ENOEXEC, bug ?
    Valery Reznic wrote:
    > [valery@localhost ~]$ cat a.sh
    > #!/bin/sh
    > echo "It's a.sh"
    > [valery@localhost ~]$ cat b.sh
    > #! ./a.sh
    > echo "It's b.sh"
    > [valery@localhost ~]$
    > [valery@localhost ~]$ strace -f -e execve setarch i386 ./b.sh
    > execve("/usr/bin/setarch", ["setarch", "i386", "./b.sh"], [/* 40 vars */]) = 0
    > execve("./b.sh", ["./b.sh"], [/* 40 vars */]) = 0
    > It's a.sh
    >

    That is the correct output for a script which is being interpreted by
    a.sh, when a.sh prints "It's a.sh" using /bin/sh as its interpreter.
    Remember, you didn't ask /bin/sh to interpret b.sh, you asked a.sh to do
    it, and a.sh is a simple echo statement, not an interpreter. There is
    no error here.


    \
     
     \ /
      Last update: 2010-03-20 10:45    [W:0.020 / U:61.932 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site