New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Bash command not found


Post Reply New Thread Subscribe

 
Thread Tools
danipoak

 
Member Since: Nov 15, 2013
Posts: 16
danipoak is on a distinguished road

danipoak is offline
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?
QUOTE Thanks
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,737
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
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?

--
Regards
...Ashwin



Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.
QUOTE Thanks
danipoak

 
Member Since: Nov 15, 2013
Posts: 16
danipoak is on a distinguished road

danipoak is offline
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.
Attached Images
File Type: png Screen Shot 2013-12-17 at 1.53.34 PM.png (100.5 KB, 17 views)
File Type: png Screen Shot 2013-12-17 at 1.53.20 PM.png (97.9 KB, 15 views)
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,474
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 13in macbook - 10.10.1

cradom is offline
Type 'echo $PATH' without the quotes. What do you get?

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
danipoak

 
Member Since: Nov 15, 2013
Posts: 16
danipoak is on a distinguished road

danipoak is offline
MY_MCNP UNEP$ echo $PATH
/Users/UNEP/MY_MCNP/MCNP_CODE/bin/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,474
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 13in macbook - 10.10.1

cradom is offline
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?

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
danipoak

 
Member Since: Nov 15, 2013
Posts: 16
danipoak is on a distinguished road

danipoak is offline
Quote:
Originally Posted by cradom View Post
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?
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,474
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 13in macbook - 10.10.1

cradom is offline
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.

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,352
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
danipoak

 
Member Since: Nov 15, 2013
Posts: 16
danipoak is on a distinguished road

danipoak is offline
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!
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,474
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 13in macbook - 10.10.1

cradom is offline
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.

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks

Post Reply New Thread Subscribe


« Drag an image or Browse Finer | Applescript Function Key »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
calling bash interactively zapatafa OS X - Operating System 2 06-16-2013 10:08 PM
Trouble finding bash files using "locate" jps2012 OS X - Operating System 0 05-11-2012 05:45 PM
Problems with terminal Vladswe OS X - Operating System 0 12-30-2009 07:03 PM
Auto-Logging BASH session quietly danjmwalker OS X - Development and Darwin 0 10-04-2007 03:19 PM
Using cc in darwin: command not found. olav OS X - Development and Darwin 2 03-28-2006 04:31 AM

All times are GMT -4. The time now is 09:41 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?