My question is similar to How do I prevent sed -i from destroying symlinks?, but concerning hardlinks.Using sed -i to work on a file destroys all the hardlinks the file has, since sed works by writing to a temporary file and then moving this.The --follow-symlinks parameter doesn't help in case of a hard link.Is there an alternative to using the rather ugly:sed 's/cat/dog/' pet_link > pet_link
How do I prevent sed from destroying hardinks?
sed;hard link