Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> sed -n 's/old/new/wfile.tmp' file

This saves only lines which underwent substitution, which was probably not what you wanted.



Missing semicolon.

  sed -n 's/old/new/;w file.tmp' file
Unlike BSD and GNU sed, it appears that Plan9 sed will append to instead of overwite file.tmp

It also requires a space after the w command.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: