Greetings.
I don't have experience programing scripts. I need to insert a string in a specific position of another string on another file (last.cfg), for example:
File last.cfg before using script:
login_interval=1800
lcs.machinename=client04
File last.cfg after using script:
login_interval=1800
lcs.machinename=newclient04
I read about awk and sed comands, by I'm not sure what use and how.
Please, I'll thank so much if someone may help me or tell me if this problem has been solve on another post.
sed "s/${TO_SEARCH}/${TO_INSERT}${TO_SEARCH}/" last.cfg
but changes have no effect in last.cfg, I have tried using -i command, but I obtanin "invalid option --i" message.
How can I save those changes on the file?
Thanks by your help.