I Have a file by the name relog.001
I want to search for a line Local=IN
If found then skip
If not found then search for a line starting with 'Testion option Ok'
then insert the line 'Local=IN' after that.
File relog.001 contents before inserting
gpg RC (54321)
Testion Option OK
AIX.SHA1.So
File relog.001 contents after inserting
gpg RC (54321)
Testion Option OK
Local=IN
AIX.SHA1.So
Note :- I am passing the Rvalue 'IN' from subroutine, and it can change like (IN or US or FR) so I need to evaluate it with a regular expression.
lvalue 'Local=Regulare xpression'.
Hope it makes sense, quick reply will be appreciated.
I want to search for a line Local=IN
If found then skip
If not found then search for a line starting with 'Testion option Ok'
then insert the line 'Local=IN' after that.
File relog.001 contents before inserting
gpg RC (54321)
Testion Option OK
AIX.SHA1.So
File relog.001 contents after inserting
gpg RC (54321)
Testion Option OK
Local=IN
AIX.SHA1.So
Note :- I am passing the Rvalue 'IN' from subroutine, and it can change like (IN or US or FR) so I need to evaluate it with a regular expression.
lvalue 'Local=Regulare xpression'.
Hope it makes sense, quick reply will be appreciated.
Comment