# Edit a file and save the changes

**URL:** <https://community.unix.com/t/edit-a-file-and-save-the-changes/186777>\
**Category:** Shell Programming and Scripting\
**Created:** [February 25, 2008, 4:38pm UTC](https://community.unix.com/t/edit-a-file-and-save-the-changes/186777 "2008-02-25T16:38:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saurabh1982](https://community.unix.com/user_avatar/community.unix.com/saurabh1982/32/4045_2.png) [@saurabh1982](https://community.unix.com/u/saurabh1982)\
**Post date:** [February 25, 2008, 4:38pm UTC](https://community.unix.com/t/edit-a-file-and-save-the-changes/186777/1 "2008-02-25T16:38:22Z")

</div>

I have an xml file that gets created as a part of daily build. I have to modify some lines in this file, uncomment some lines, comment some line, add 2 new lines in the file every time.  
Is there an easier automated way to do this using perl, bash, or sh. I would appreciate it if someone can point me to a solution so I do not have to do this manually everyday.

SD

---

<div class="post-metadata">

**Author:** ![mirusnet](https://community.unix.com/user_avatar/community.unix.com/mirusnet/32/749_2.png) [@mirusnet](https://community.unix.com/u/mirusnet)\
**Post date:** [February 25, 2008, 6:07pm UTC](https://community.unix.com/t/edit-a-file-and-save-the-changes/186777/2 "2008-02-25T18:07:31Z")

</div>

You need to specify what exactly you want to do.
