Hi all,
I am struggling to change the content of a file without changing the inode number. The exact issue is as below.
I have a file name test.bak which has 100 lines of text.
I am trying to to delete the first 90 lines of the text in the file.
I know that using sed/awk/head/tail I can delete the lines.
But the general procedure is as follows.
- Use sed/awk/head/tail to delete the 90 lines in test.bak
- Re-direct to a temporary file. (tmp.bak)
- Move the temporary file (tmp.bak) to the original file name (test.bak).
When I move the temporary file to the original file,the inode number of the original file changes. I want to retain the inode number of the original file.
How can I do that?
I am using Solaris 10.
Please help.