Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

While I am able to execute binaries, when the terminal is open, if I type:

/bin/bash make

or

/bin/sh ls

I get: /usr/bin/make: /usr/bin/make: cannot execute binary file

Why is that? I am on Mavericks, and I have installed the latest Command Line Tools of XCode.

I want to use bash to execute make, because I want to setup external build tools for AppCode.

Cheers

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

When you call /bin/bash with only one argument, you can only run scripts. Not binaries. This has nothing to do with the tools you installed, it's just the behavior described in the man page.

/bin/bash -c ls should do what you want.

share|improve this answer
    
Thanks a lot! I have another question. When I execute /bin/bash the PATH env. var is not set. Are there any CLA for bash to run my .profile file? –  Paschalis yesterday
    
@Paschalis The -l argument will make the shell a "login" shell, meaning it will execute your .profile/.bash_profile/etc. –  0942v8653 yesterday
    
Hmm, it didn't worked, but I found a workaround for my case! THANKS! –  Paschalis yesterday
1  
@Paschalis It works for me, but as a more general way, the --init-file option will allow you to specify a file to run at startup. –  0942v8653 yesterday
    
Note that if you have Terminal open, you are already running bash (unless you changed your default shell). Thus, all you have to do to have bash run ls is type the command ls. When you type /bin/bash -c ls, that tells bash to run another instance of bash, and have that instance run ls. I can't think of a reason to bother with that second bash instance... –  Gordon Davisson yesterday
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.