lkml.org 
[lkml]   [2006]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Executable shell scripts
    On Sat, May 13, 2006 at 01:03:24PM +0200, Mark Rosenstand wrote:
    > It doesn't:
    >
    > bash-3.00$ cat << EOF > test
    > > #!/bin/sh
    > > echo "yay, I'm executing!"
    > > EOF
    > bash-3.00$ chmod 111 test
    > bash-3.00$ ./test
    > /bin/sh: ./test: Permission denied

    Obviously.

    It executes the script, finds that it needs an interpreter and runs /bin/sh
    as specified telling it to run the script. /bin/sh though needs to read
    the script in and since the script has no read permissions it fails.
    Hence permission denied.

    --
    "To the extent that we overreact, we proffer the terrorists the
    greatest tribute."
    - High Court Judge Michael Kirby
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-05-13 13:25    [W:0.019 / U:92.344 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site