[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Automatic password changing



Tim Haynes writes:
| Not quite. It seems to ignore the filename on the end of the #! line, and you
| forgot my mod to make it do the right thing re: 'rest of line' :
| 
| 	#!/usr/bin/perl -npi.bak
| 
| 	s/^root:[^:]*:(.*)$/root:pants:\1/o

That should be $1 in the replacement.  \1 works for now only for
backwards compatibility, and not always even then.  Use $1.  But you
shouldn't need the capture-replace at all:

	/^root:[^:]*:/root:pants:/

The /o doesn't get you anything here, since you're not interpolating
any vars.

Mx.


Reply to: