--in-place describes what appears to be performed!sedXXXXXX' where XXXXXX is a string of random characters.
As processing progresses output is written to the temporary file.
Upon completion the original file is unlinked(removed) and the temporary file is renamed to the original name.
file is writable but its directory is not!--in-place on a file without write permission will result in the
All file dates being updated and may change contents of the file.sed d --in-place will delete the contents of a read-only file !
Attempts to operate on a writeable file in a non-writable directory will produce the error message:
sed: couldn't open temporary file seduwDhDf: Permission denied
and exit with a code of 4.
archived, opaque, nodump, sappend, uappend, simmutable, immutable and hidden,
ACL and eXended attributes are lost.The timestamps on the output file will be now().
ls -log 0*
-rw-r--r-- 2 11 Jun 5 12:46 0
-rw-r--r-- 2 11 Jun 5 12:46 0x
sed --in-place "s/./x/" 0
ls -log 0*
-rw-r--r-- 1 11 Jun 5 12:47 0
-rw-r--r-- 1 12 Jun 5 12:46 0x
When a symbolic link is operated on it is removed and the temporary file is renamed
using the name of the symbolic link.
For example:
ls -log 0*
-rw-r--r-- 1 12 Jun 5 12:57 0
lrwxr-xr-x 1 1 Jun 5 12:57 0s@ -> 0
sed --in-place "s/./xx/" 0s
ls -log 0*
-rw-r--r-- 1 12 Jun 5 12:57 0
-rw-r--r-- 1 13 Jun 5 12:59 0s
-rw-r--r-- 1 12 Jun 5 12:57 0