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

Try `sed -i ""` to avoid creating a backup.


When you use sed -i, a temporary file is always created.

Using FreeBSD as an example, see references to "tmpfname" in main.c:

https://raw.githubusercontent.com/freebsd/freebsd/master/usr...

The naming scheme differs between seds. GNU prefixes the name with "sed" while BSD encloses it between two "!"'s.

To see the name of the temporary file on BSD, something like

  ktrace sed -i 's/foo/bar/' file
  kdump ktrace.out|sed -n '/NAMI/p'




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

Search: