hello,
I have problem with writing/adjusting a shell script.
I searched forum and unfortunately couldn't write scipt based on the information I found.
I never wtire such so it's hard for me and I do need to modify one script immediately.
case looks like:
- 'file' that needs to be modified
- 'script' - it has commands in order to modify a 'file'
'script' has to modify 'file' according to the rule:
Each time when a 'string' is found inside a 'file' then a new line should be added with variable and its value.
example:
'file' has:
something, something
something string more
something, something
hello world, string
'script' should serach for 'string' and each time when it find it then a new line with variable $$var1=5 should be added.
after modification 'file' should look like:
something, something
something string more
$$var1=5
something, something
hello world, string
$$var1=5
can someone tell me how to do this?
thanks a lot!