Previous 1 2 3 Next 71 Replies Latest reply: Apr 10, 2013 4:05 AM by mikeamy
galfenol Level 1 (0 points)

My unix scripts are now dead, after the upgrade to 10.7.3. A typical error message is   /bin/bash: bad interpreter: Operation not permitted  Googling this issue shows other people are having build scripts fail and are fixing this by renaming links to libraries.  My scripts are simple, they just run an executable, or used to...  something like this:

#! /bin/bash

./myprogram << EOF

$1

EOF


MacPlus, SE30, iMacG3, EmacG4, PB G4, iMacG5, PowerMacG5, iMac Intel, Mac OS X (10.7.2)
  • etresoft Level 7 (27,848 points)

    Where is "."? Have you installed programs into /usr or /bin somewhere? If so, they are gone. /usr/local would be a better place for them.

  • Linc Davis Level 10 (192,821 points)

    The interpreter is the thing that comes after "#!"; in your case, /bin/bash. Are you able to open a shell in Terminal? If so, what is your shell, and what do you get from

     

    ls -Oel /bin/bash
    

     

    and

     

    codesign -vv /bin/bash
    
  • galfenol Level 1 (0 points)

    The ./myprogram means run the executable in the current working directory. This is not a problem with my bash scripts gone missing. They are right there in front of me. They just don't run any more.

  • galfenol Level 1 (0 points)

    Yes. My default shell is bash at the moment.

     

    ls -Oel /bin/bash 

    -r-xr-xr-x  1 root  wheel  compressed 1371648 Jul 11  2011 /bin/bash

     

    codesign -vv /bin/bash

    /bin/bash: satisfies its Designated Requirement

  • Linc Davis Level 10 (192,821 points)

    What do you get from "ls -@Oel" on one of the problem scripts?

  • galfenol Level 1 (0 points)

    Something like this, where the shell script is fistofdeath.sh.

    The script has been made executable with chmod +x, or at least this used to work.

     

     

    bash-3.2$ ls -@Oel ./fistofdeath.sh

    -rwxr-xr-x@ 1 galfenol  staff  - 37 Feb 12 10:37 ./fistofdeath.sh

              com.apple.FinderInfo          32

              com.apple.ResourceFork          63127

              com.apple.TextEncoding          15

              com.apple.quarantine          23

    bash-3.2$

  • etresoft Level 7 (27,848 points)

    Yes, but the current working directory is highly context-dependent. Are you able to execute a script that just calls "env" or "echo"?

     

    Maybe remove that space before /bin/bash and see if that helps.

  • Linc Davis Level 10 (192,821 points)

    Remove the quarantine attribute from your files as follows:

     

    find ~ -exec xattr -d com.apple.quarantine {} 2> /dev/null \;
    
  • galfenol Level 1 (0 points)

    The space makes no difference. I have no luck with a script like this, which I just wrote.

     

    bash-3.2$ more hello.sh

     

    #!/bin/bash         

    echo Hello World 

     

     

    bash-3.2$ ./hello.sh

    bash: ./hello.sh: /bin/bash: bad interpreter: Operation not permitted

  • galfenol Level 1 (0 points)

    How long should this command run for? Its taking a looong time.

    But your advice suggests using disk utility to check permissions.

    I will do that next, it the find command ever finishes.

  • Linc Davis Level 10 (192,821 points)

    Depends on how many files you have. It might take hours.

     

    If clearing the quarantine attributes doesn't help, then repairing permissions would be a reasonable thing to try, though I doubt it will do any good. More likely, you'll need to reinstall the OS.

  • BobHarris Level 6 (17,729 points)

    I think Linc is on the right track, but just in case, what is the contents of your /etc/shells file?  Mine looks like the following:

     

    # List of acceptable shells for chpass(1).
    # Ftpd will not allow users to connect who are not using
    # one of these shells.
    
    
    /bin/bash
    /bin/csh
    /bin/ksh
    /bin/sh
    /bin/tcsh
    /bin/zsh
    
  • galfenol Level 1 (0 points)

    I have 2 machines, both iMac i7, that exhibit this problem after installing 10.7.3.

  • galfenol Level 1 (0 points)

    bash-3.2$ more shells

    # List of acceptable shells for chpass(1).

    # Ftpd will not allow users to connect who are not using

    # one of these shells.

     

     

    /bin/bash

    /bin/csh

    /bin/ksh

    /bin/sh

    /bin/tcsh

    /bin/zsh

Previous 1 2 3 Next