-   Linux - Newbie (
-   -   Shell script to edit a file (

kaash_m31 06-02-2008 05:19 AM

Shell script to edit a file
Hi Experts,

I am new to shell scripting.I have a requirement, in which I have to fill a value of a parameter using a script.

for example:
I have a file ("testfile.txt") whose contents are:
line1.color: red

In the above content of file, I have to fill the third parameter with some value say "/usr/dir". Please help me in writing a script to fill that value.
Thanks in advance.

unSpawn 06-02-2008 05:36 AM

If you have no clue then best start here I think:

pinniped 06-02-2008 05:43 AM

Sounds like a job for 'sed' (I can't see how the shell would do it all - then again I'm definitely no shell guru).

This sounds like homework to me, so I'll say: read the sed manual

All times are GMT -5. The time now is 08:42 AM.