I have searched for other questions here, but in reality there is no one working for me. I am trying to select a specific line and change that string with another string. So I have a file called my_course, which I'm trying to modify a row in "my_search" which starts with "123" on that line I want to change the string with "0", "1". Help
A possibility sed : In the first Redirect the output using If you are using destructive version of the location, then you have given the original version when anything went wrong. Besides placing a copy with the extension, you will want to use Edit: To match the desired lineup with a prefix stored in one variable, you will need to add the sed script with double quotes using a single code
Sed '/ ^ 123 / s / 0/1 /' my_course
/../ Specify the pattern that you are looking for
^ 123 for the line beginning with 123
...;
-iEXTENSION .
"
' will prevent variable extension:
sed "/ ^ $ input / s / 0/1 /" my_course
No comments:
Post a Comment