I have managed to change the present working directory to the folder containing downloaded rEFInd files. I have booted to Recovery Mode. The refind-bin-0.11.3 folder was downloaded to my Downloads folder.

I came across a new problem: ‘bad interpreter: no such file or directory’.

How can I fix this problem?

  • I've edited the question down to just the latest unresolved problem. Feel free to expand further to add some context. – grg Aug 2 '18 at 6:27
  • the users messengerm? Lol. That could lead to some mistakes if a space is misplaced. – JBis Aug 7 '18 at 13:11
  • Yes, Messengerm, it doesn't have underscore between, thought I could add a space between the two, but couldn't. but making changes in the user name can happen. but can't get Mac OS X to keep the user name in high caps. so yeah.....no mistake in username. Mac OS X will not allow to have space between "messenger" and "m" but yeah, we all choose names and who we want to be...... – user291594 Aug 8 '18 at 18:03
  • but other than that Jbis......this is the problem I came across in terminal........ env is missing and I got the error message -bash: ./refind-install: /usr/bin/env: bad interpreter: No such file or directory. this terminal is from recovery mode partition. – user291594 Aug 8 '18 at 18:03
  • @Jbis A space being misplaced? I don't see where....I can see error message so maybe it's caused by some mistakes. but we need to be very serious. plus I tried two command line paths in recovery partition, one was . refind-install and other was source refind-install, both lead me to an BSing error message telling me refind binary file is missing(it's talking about refine-bin-0.11.3 file being missing)... – user291594 Aug 11 '18 at 3:55

I suspect the ‘refind-install’ script has a shebang pointing to /usr/bin/env, such as

#!/usr/bin/env bash

The Recovery environment doesn't have a /usr/bin/env, so attempting to access that path returns the error that there's ‘no such file or directory’ there.

You can manually choose a shell to execute a script with by passing the script to the shell:

bash ./refind-install

Alternatively, you should be able to edit the script to point directly at the shell. Replace the first line in the script with something like this, presuming the line above is what's in the file.


Note the space has been removed.

I have `/usr/bin/env` in my "Macintosh HD" but not in the recovery partition. Is this normal?

  • If you're talking about the rEFInd-Install script, How do I edit the script? mind giving the walk through? much appreciated. – user291594 Aug 5 '18 at 1:04
  • @M3553N63R See edited answer for running a script with a shell of your choice without editing the shebang by JBis – grg Aug 7 '18 at 17:48
  • You don't want to run a script in "any" shell because each shell has its own syntax. While ksh,zsh, and bash use bourne like syntax that is the same in each shell, they also have syntax that is unique to each shell. Best practice would be to read the first line ( the shebang)- head -n1 refind-install then use that shell within the shebang. – fd0 Aug 7 '18 at 18:28
  • tried Bash ./refind-install then like always I get told "copying sample configuration file as refind.conf; edit this file to configure rEFInd. – user291594 Aug 13 '18 at 8:19
  • @David Anderson Can we speak in chat room? – user291594 Aug 23 '18 at 22:30

You must log in to answer this question.