How can I run a bash script on my mac?

Discussion in 'Mac Apps and Mac App Store' started by msmth928, Jul 15, 2009.

  1. msmth928 macrumors regular

    Joined:
    Jun 3, 2009
    #1
    I am creating a bash script for a linux server, but I want to develop it on my mac and simple see the results of the script when it runs locally (it's doing simple math). Any ideas how I can do it?

    Any help appreciated!
     
  2. weinrdog macrumors newbie

    Joined:
    Oct 25, 2007
    Location:
    o-HI-o
  3. Cinder6 macrumors 6502

    Cinder6

    Joined:
    Jul 9, 2009
    #3
    Or:

    Make sure you have the shebang line (#!/bin/bash as the first line of the file), then 'chmod +x yourscript.sh', then you can run it with './yourscript.sh'.
     
  4. msmth928 thread starter macrumors regular

    Joined:
    Jun 3, 2009
    #4
    Thanks - that was easier than I thought it'd be! :apple:
     

Share This Page