For example:
I have a txt file like :
text(“hello”)
text(“world”)
text(“once”)
text(“again”)
Aim to replace
hello with string_1,
world with string_2,
once with string_3,
again with string_4,
How to write the script?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
the above command will do inplace replacement.if you want the ouput to console,then,
remove “
i“.another way is :
awk: