Find the answer to your Linux question:
Results 1 to 9 of 9
$ls -l /bin/sh -rwx-r-x-r-x 1 root root 8132 Apr 3 2002 /bin/sh When I run any shell script, it tells me this: bash: ./test: /bin/sh: bad interpreter: Permission denied Any ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    URGENT


    $ls -l /bin/sh
    -rwx-r-x-r-x 1 root root 8132 Apr 3 2002 /bin/sh

    When I run any shell script, it tells me this:
    bash: ./test: /bin/sh: bad interpreter: Permission denied

    Any ideas? I tried running this as root and as normal user.
    The best things in life are free.

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    8132 bytes? That seems incredibly small for a shell. Can you run /bin/sh at all? Hadn't you installed some shell other than bash? Maybe something has happened to it (I dunno why, but just maybe). Until you can solve it, maybe you had better just "ln -sf bash /bin/sh".

  3. #3
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Dolda,

    Remember, when my /bin/sh is pointing at /bin/ash. That's the result I posted.
    Yes, I can invoke ash (/bin/sh) from the command line. It only complains when I try to use it as a shell script. I tried using #!/bin/bash and the samething happens.
    Everything was fine a week ago and the only thing that I did to the system was remove the group "brock."
    The best things in life are free.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    You sure you are not trying to exec the scripts on a partition mounted with noexec?

  6. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Yeah, I thought of that as well, but that just seems too crazy. Can binary programs be executed from the same directory, and do the system shell scripts work (like nroff)?

  7. #6
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Binary programs can be executed. It's just the shell scripts in any directory keeps popping that message. Any ideas? I'm so confused as to what made this happen on the system.
    The best things in life are free.

  8. #7
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Man, you guys are going to kill me but I realized that the permission in all files in my directory was reset at a certain time. I deeply apologize for this stupid problem.
    The best things in life are free.

  9. #8
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Actaully, I'm glad that I ran into this. Would I just add the word "exec" to the appropriate filed in /etc/fstab to make executables run on mounted partitions?
    The best things in life are free.

  10. #9
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    You can execute files by default so as long as it doesn't say noexec, it should work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •