overwrite the contents of a textfile in unix

October 21, 2012 at 05:37:23
Specs: Windows 7
hello.I am new to this site.Infact first timer. :)

I am creating a file "xyz.txt" in unix.Saving some values in it.
This whole thing is in a script,and i need to run the script several times.
Each time the script runs i want it to overwrite the previous content.

Any help regarding this will be truly appreciated.

Regards,
Vishnu


See More: overwrite the contents of a textfile in unix

Report •

#1
October 21, 2012 at 09:21:13
Each time you execute your script, the file should be overwritten unless the "xyz.txt" file was created with only read permission for the owner.

As a beginner, you probably have questions about file permissions, ownership, and the chmod command. This link is probably as good as the thousands of links on the web:

http://www.perlfect.com/articles/ch...

Let me know if you have any further questions.


Report •
Related Solutions


Ask Question