Mac cant understand the error

akaash1087

macrumors newbie
Original poster
Jul 7, 2010
23
0
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.....
 

Cromulent

macrumors 603
Oct 2, 2006
6,039
36
The Land of Hope and Glory
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.
 

akaash1087

macrumors newbie
Original poster
Jul 7, 2010
23
0
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
 

misee

macrumors member
Jul 4, 2010
65
0
You should choose Terminal as your default app for opening command files.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.