Safely modifying a passwd file (in a perl script, e.g.)

mf mf at ircam.UUCP
Fri Mar 4 16:25:25 AEST 1988


A shorter way to do this in sh is to make use of the fact that
a simple command can be invoked while passing it an environment
variable.  So in sh one will say:
 		EDITOR="cp /tmp/newpasswd" /etc/vipw
and in the corresponding perl script
 		system('EDITOR="cp /tmp/newpasswd" /etc/vipw');



More information about the Comp.unix.wizards mailing list