i have a question. I need to add a text line into a txt file. This is my file:
- 000
- 001 test1
- 002 test2
- 003 test3
- 004
- 005 test4
- 006 test5
- 007 test6
I need with bash scripting to add text in line 000 and 004.
How can i do?
Thanks to all!
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.
You can use the “sed” tool to acheive your goal. It is quite powerful for manipulating files.
You can use a command like this:
(If I understand correctly, you have “000” at the begining of the first line of your file, and “004” for the fifth one)