Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!mit-eddie!uw-beaver!zephyr.ens.tek.com!tektronix!sequent!yuf From: yuf@sequent.UUCP (Kyle Grieser) Newsgroups: comp.editors Subject: Re: Changing mode before starting vi Message-ID: <40977@sequent.UUCP> Date: 21 Aug 90 01:22:48 GMT References: <1990Aug20.180936.29942@ecn.purdue.edu> Reply-To: yuf@crg2.UUCP (Kyle Grieser) Distribution: na Organization: Sequent Computer Systems Inc. Lines: 24 In article <1990Aug20.180936.29942@ecn.purdue.edu> patkar@bromine.ecn.purdue.edu (The Silent Dodo) writes: > cp /dev/null $1 > chmod 700 $1 > vi $1 > > But this looks clumsy. Is there a better way than this? > Probably there is some option you can set in your .exrc, but > I could not find any such thing in the online help command. This really has nothing to do with vi. As you may have noticed, the "cp /dev/null $1" probably made the file 644 also. This is what the file will always be made as. You need to set your umask to be something that will mask the permission bits when you make a file. Basically, "umask 022" in your .profile (or .login) will make files of modes 755 and 644 while umask 077 will make them 700 and 600. Read the man page for umask for a clearer understanding of how it works. It basically uses the umask value as a mask for the permission bits. ---- Kyle Grieser ...!sequent!yuf Sequent Computer Systems Inc. sequent!yuf@uunet.uu.net 15450 S.W. Koll Parkway Beaverton, OR 97006 (503) 626-5700