0

I have a file1.txt and the file content is "a b c" and when dynamically i am changing the content of the file1.txt to "1 2 3" through html page.when I reboot my system the content of the file1.txt are not updating that means the content will be same as "a b c".how can I save my file1.txt file before reboot/shutdown using shell scripting.


I have an file3.htm in that page I am searching for a matching string and file3.htm and replacing that string with the replacing string and that out put I am diverting it to other file using sed command

sed -e 's/Ip_address/'$IP'/g' file3.htm > file4.htm 
4
  • 1
    How are you changing the file? Post some code, please. Commented Jun 11, 2013 at 10:54
  • I have an file3.htm in that page I am searching for a matching string and file3.htm and replacing that string with the replacing string and that out put I am diverting it to other file using sed commond sed -e 's/Ip_address/'$IP'/g' file3.htm > file4.htm
    – amar
    Commented Jun 11, 2013 at 11:05
  • where IP taking from Html page
    – amar
    Commented Jun 11, 2013 at 11:07
  • 1
    You can use sync to manually synchronise the kernel file buffers with the files on the hard disk. I did not put it as a solution, because this is not a guarantee. If data is still stuck in user space buffers, the sync call does nothing. Give it a try!
    – Peter DW
    Commented Jun 11, 2013 at 11:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.