Bash command not found

Joined
Nov 15, 2013
Messages
54
Reaction score
0
Points
6
I am working on installing a physics simulation software package. It comes with a script that is supposed to compile the source code and install all of the data libraries for the simulation software. The installation exited with an error so I then thought maybe I needed to execute the script in sudo for it to work. When I type sudo I get the following:

-bash: sudo: command not found

I have also checked to see if a few other things are installed like gcc and command lines tools but I always get responses like
-bash: gcc: command not found
-bash: xcode-select: command not found

This leads me to believe that the problem is not with the script to install but with OSX. This is being installed on a fresh installation of 10.9, any advice?
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,762
Reaction score
2,100
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
A fresh installation of OS X will not have the developer tools. You need to install XCode which will give you the command line GCC and other related tools.

As to 'sudo' not working, that's a bit strange as that should be part of the the base OS X installation.

What happens when you type
Code:
which sudo
on the command line?
 
OP
D
Joined
Nov 15, 2013
Messages
54
Reaction score
0
Points
6
I should have clarified fresh installation. I was having these problems so I reformated and installed xcode and command line tools. Command line tools were installed from a .dmg file downloaded form the apple developer site so everything *should* be installed that is necessary.

When I do "which sudo" I get the same bash command not found jargon. In the past I could see command line tools installed from the downloads tab in preferences but it is not listed there this time. I did find it listed in the locations tab though. I attached two screen shots of what I see in xcode.

Screen Shot 2013-12-17 at 1.53.34 PM.png

Screen Shot 2013-12-17 at 1.53.20 PM.png
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Type 'echo $PATH' without the quotes. What do you get?
 
OP
D
Joined
Nov 15, 2013
Messages
54
Reaction score
0
Points
6
MY_MCNP UNEP$ echo $PATH
/Users/UNEP/MY_MCNP/MCNP_CODE/bin/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Your Path is messed up.
/Users/UNEP/MY_MCNP/MCNP_CODE/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
See where I put the colon after _CODE/bin ? As is /usr/bin is not found. Are you using a .bashrc or .bash_profile or .profile file in your Home folder?
 
OP
D
Joined
Nov 15, 2013
Messages
54
Reaction score
0
Points
6
Your Path is messed up.
/Users/UNEP/MY_MCNP/MCNP_CODE/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
See where I put the colon after _CODE/bin ? As is /usr/bin is not found. Are you using a .bashrc or .bash_profile or .profile file in your Home folder?

I am using .bash_profile. Here is what the file looks like right now:

Code:
export DATAPATH=/Users/UNEP/MY_MCNP/MCNP_DATA$DATAPATH
export PATH=/Users/UNEP/MY_MCNP/MCNP_CODE/bin$PATH

does something on one of those two lines need to be changed or something added to it?
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Edit it so it says
Code:
export DATAPATH=/Users/UNEP/MY_MCNP/MCNP_DATA:$DATAPATH
export PATH=/Users/UNEP/MY_MCNP/MCNP_CODE/bin:$PATH
At the end right before $PATH you need a colon. Not really sure about the first one but try anyway, right before $DATAPATH, another colon.
Restart Terminal so it takes.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
cradom's answer should fix this since many of the build tools that you'll need - gcc, make, xcode-select - are in /usr/bin. Since that isn't getting properly registered now, a quick fix to the env variable in your .bash_profile should clear this up nicely.
 
OP
D
Joined
Nov 15, 2013
Messages
54
Reaction score
0
Points
6
Thank you thank you everyone! It all installed correctly this morning. I'm curious how the bash become messed up being a fresh install but oh well, it's fixed now!
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Looks like whatever script installed that MCNP_CODE stuff didn't add to the $PATH correctly. Programmers make mistakes too.
Glad you got it right.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top