Results 1 to 11 of 11
  1. #1


    Member Since
    Nov 15, 2013
    Posts
    52
    Bash command not found
    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?

  2. #2

    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,806
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 6S, iPod Nano 7th GeniPad 3
    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.

  3. #3


    Member Since
    Nov 15, 2013
    Posts
    52
    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 Attached Images

  4. #4

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Groves, Texas
    Posts
    4,611
    Specs:
    21in. iMac 10.11 --- HP Linux Mint 18
    Type 'echo $PATH' without the quotes. What do you get?
    One manís theology is another manís belly laugh.
    -Lazarus Long

  5. #5


    Member Since
    Nov 15, 2013
    Posts
    52
    MY_MCNP UNEP$ echo $PATH
    /Users/UNEP/MY_MCNP/MCNP_CODE/bin/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin

  6. #6

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Groves, Texas
    Posts
    4,611
    Specs:
    21in. iMac 10.11 --- HP Linux Mint 18
    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?
    One manís theology is another manís belly laugh.
    -Lazarus Long

  7. #7


    Member Since
    Nov 15, 2013
    Posts
    52
    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?

  8. #8

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Groves, Texas
    Posts
    4,611
    Specs:
    21in. iMac 10.11 --- HP Linux Mint 18
    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.
    One manís theology is another manís belly laugh.
    -Lazarus Long

  9. #9

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    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

  10. #10


    Member Since
    Nov 15, 2013
    Posts
    52
    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!

  11. #11

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Groves, Texas
    Posts
    4,611
    Specs:
    21in. iMac 10.11 --- HP Linux Mint 18
    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.
    One manís theology is another manís belly laugh.
    -Lazarus Long

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Learning the Command Line - Bash Prompts (1)
    By vansmith in forum OS X - Operating System
    Replies: 0
    Last Post: 04-15-2014, 07:45 PM
  2. -bash g++:command not found
    By Brightsun in forum OS X - Development and Darwin
    Replies: 4
    Last Post: 04-22-2012, 10:20 AM
  3. bash: make: command not found
    By yousemeti in forum OS X - Development and Darwin
    Replies: 9
    Last Post: 02-29-2012, 05:28 PM
  4. bash command window size
    By wfs123 in forum OS X - Operating System
    Replies: 0
    Last Post: 08-07-2011, 05:51 PM
  5. bash 'export' command not working
    By msae in forum OS X - Operating System
    Replies: 8
    Last Post: 07-05-2011, 12:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •