751 doesn't make much sense for scripts - it allows "others" to execute the file, but not read it. (For scripts, which don't get setuid honored, this is impossible.)
To set default permissions for newly created files, you can use either umask (per-process) or default ACLs (per-directory). But they both can only remove permission bits; neither of them will add the "executable" bit automatically unless the program specifically asks for it. (For example, fopen()
always requests 0666, the sane default for files.)
You will have to follow mjb's suggestion of writing a script that creates a file and immediately updates its permissions. Alternatively, run your practice scripts like perl foo.pl
, which does not require the executable bit.
1Why don't you write a script to create a new one with the correct permissions?
#!/bash/bin touch $1; chmod 751 $1
– beatgammit – 2011-04-05T19:19:49.813