in reply to How do I modify a single line in a file?

Don't know if this is in one of the above references...
Anyway maybe from the commandline:
perl -p -i -e ' s/whatever/whateverelse/ if /whateveryou'relookingfor/ + ' /etc/passwd
----------------------------------- --the good, the bad and the physi-- -----------------------------------