I wasn't sure whether you wanted to include the quotes? (') I included them in this example:
Code:
sed -i.bak 's#\('"'"'/etc/passwd\ |grep\ "^\)molis\(:"'"'"'\)#\1wam\2#g' *
(copy and paste this, mind the quotes!)
This sed finds all strings
<everything>'/etc/passwd |grep "^molis:"'<everything>
and replaces.
It makes a backup of the original files because of the .bak option.
Without backups it would be -i
I you need more explanation of this command, post so. Cya!