I have a file named .ignore. In need to replace the projdir. For example:
ignore \..*
ignore README
projdir Snake
I need to replace Snake with, for example, "PacMan". I read the man page, but I have no idea what to do.
|
I have a file named
I need to replace Snake with, for example, "PacMan". I read the man page, but I have no idea what to do. |
||||
|
|
|
Search for a line that starts with
|
|||
|
|
|
One approach is to rewrite the entire line, using backreferences for the parts you want to keep:
Another approach is to rewrite that part of the line, but only if some other part matches:
Both examples rewrite the second whitespace-delimited word on lines where the first word is |
|||
|
|