--
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
: >how can i make the default for my shell-environment to be such that when
: >i create a new file (ie, touch
: ><filename>; vi <filename>) it is executable? as far as i can tell, umask doesn't
: >allow this behavior.
: There's no way to do this in standard Unix. The program that creates the
: file decides which permissions to turn on by default, and umask specifies
: which of them to turn off. Programs that are designed to create executable
: files (mainly compilers and linkers) and directories include the executable
: bits in their default permissions, and just about everything else doesn't.
: --
: Genuity, Burlington, MA
: *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
: Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
Net-Tamer V 1.08X - Test Drive
#!/bin/ksh
Then you can do "mytouch filename" to create executable files; it won't
cause "vi filename" to create executables, but you could create a "myvi"
script that does that.
>: There's no way to do this in standard Unix. The program that creates the
>: file decides which permissions to turn on by default, and umask specifies
>: which of them to turn off. Programs that are designed to create executable
>: files (mainly compilers and linkers) and directories include the executable
>: bits in their default permissions, and just about everything else doesn't.
Chris Mattern
> Rewriting the shell won't do any good because the shell has nothing
> to do with it. This behavior is part of the program's (vi's, touch's,
> etc.) code. To change this behavior, he'd have to patch vi, touch,
> and every other program he wants to write executable files.
> Chris Mattern
I really don't think you would want that as default behaviour.
I use the following shell script to edit shell scripts:
#!/bin/sh
# create and edit a shell script
if [ "$1" ]
then
if [ ! -s $1 ]
then
echo "#!/bin/sh" > $1
fi
chmod a+x $1
${EDITOR:-emacs} $1
fi
--
Chris F.A. Johnson
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Everything in moderation - including moderation
1. file permissions/permission execution
We are novice CGI users/scripters having problems with permission
executions for use in CGI forms.
The message we have been getting is as follows " FORBIDDEN you don't
have permission to access "......etc." on this server"
How do we remotely perform permission executions from a mac to a UNIX
server.
Than
--
Posted via Talkway - http://www.talkway.com
Exchange ideas on practically anything (tm).
2. Opinions: Best book on Linux (advanced)
3. Newbie: Unix File Permissions on HTML files?
4. Recursively replace a name in several files
5. Question about file permissions - sharing data files between multiple users
6. socket reads and error returns
7. file permissions & group membership when uploading files via FTP
9. mail problem: file permissions for lock file
10. Setting default file permissions on ftp'd files.
11. I get "file permissions deny server execution" on gif files in cgi-bin, why?
12. ftpd, default file permissions on creating a file on Solaris, SunOS 5.5.1
13. default file permissions for ftp'd files