[LBo] How to set default permissions

Stefan Waidele jun. Stefan at Waidele.info
Fri Jun 2 12:53:18 CEST 2006


Emen Zhao wrote:
> [...]
> I am a lazy guy 

Ah, lazyness. The core virtue of Perl-Programmer :)

> (seems most IT guys enjoy “lazy”.J), so that trying to find out if 
> anyway can make life easier. 744 should be fine by me.

How about a script like the following:

--8<-----[ newperl.sh ]-------------------------
#! /bin/bash

echo >$1  "#! /usr/bin/perl -w"
chmod 0744 $1
emacs  $1 &
--8<--------------------------------------------

Usage: ./newperl.sh scriptname

This would create the file "scriptname" for you (including the shebang), 
change the permissions and start the editor with the new file loaded.

Put the script into /usr/bin/ and you can ommit the ./

Good enough?

Stefan

PS: You can change the editor, of course :)



More information about the QnA mailing list