One thing I plan to be doing is writing (painfully simple) Perl scripts, and I'd like to be able to run them without explicitly calling Perl from the terminal. I appreciate that, to do this, I need to grant them execute permissions. Doing this with chmod is easy enough, but it also seems like a slightly laborious extra step. What I would like is one of two things:
Firstly, is there a way to set the execute flag when saving a file? Currently I'm experimenting with gedit and geany, but would be willing to switch to a similarly- (or better-) featured editor if it had this capability.
Failing that, is there a way to declare that all files created in a particular directory should have execute permissions?
My umask is set to 022, which should be OK, as far as I understand, but it would appear that the files are created as text files (with 666 default permissions) rather than executable files (with 777 default permissions).
Perhaps I'm just being lazy, but I figure there must be a more convenient way than chmodding every single script one creates.
question from:
https://stackoverflow.com/questions/817060/creating-executable-files-in-linux 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…