cant understand the error

Discussion in 'Mac Programming' started by akaash1087, Jul 27, 2010.

  1. akaash1087 macrumors newbie

    Joined:
    Jul 7, 2010
    #1
    I am new to MAC OS X.I have made a shell script and have placed it on the desktop and I want that it should run it when I double click on the icon.Should I save the file with .scpt extension?When I double click it,A window opens up which shows options "Run" , "compile" and a few others.When I click on "Run" ,it gives an error "expected end of line etc, but found identifier"

    similar posts have been there but couldnt quite understand the answers
    Any help would be appreciated.....
     
  2. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    You need to use the .command extension if you want to be able to double click on shell scripts and have them execute, .scpt is for AppleScripts.

    You'll also need to make sure the shell script has the execute bit set in its permissions for at least yourself.
     
  3. akaash1087 thread starter macrumors newbie

    Joined:
    Jul 7, 2010
    #3
    I have already tried that

    I have already tried that,on double clicking it opens the script in texteditor.Thats probably because I ve selected text editor as default app,But then which app do I chose?

    I have given myself execute permission,but still it doesnt execute
     
  4. misee macrumors member

    Joined:
    Jul 4, 2010
    #4
    You should choose Terminal as your default app for opening command files.
     

Share This Page