View Single Post
Old 01-25-2009, 01:59 PM   #108
pilotbob
Grand Sorcerer
pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.
 
pilotbob's Avatar
 
Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
Quote:
Originally Posted by wallcraft View Post
The reason for this suggestion is that under Unix a file must have "execute" permission to be used as a stand-alone command. The Mac seems to be a bit different, but I think something similar is going on. I don't know how to change permissions on a Mac, but python should still be able to execute the script directly. You should then get the usage message you are looking for.
You use chmod just like you do in Linux.

chmod 755 ereader2html.py

But, those scripts don't have a shebang in them. So, bash won't know how to run them. If you add the shebang it should work. Also, I have found that I needed to change the line endings to Unix type rather than the DOS type that was in the files that I downloaded.

But passing it to python should work fine even if it isn't marked executable:

python ereader2html.py

Should return a usage banner.

BOb
pilotbob is offline   Reply With Quote