Quote:
Originally Posted by yongho
Could anyone tell me what the second line in this block of code in this here-document does.
vi /tmp/irfelogls2.txt <<!
:%s / P/P/
:wq!
!
1. Opens file.
2. Performs command ":%s / P/P/"
3. Write, and force-quit the editor.
Hm..
I think what it's doing is, searching for a regex of " P" and then replacing it with just a "P".. correct?
Edit: Ehh.. sorry... what a waste of a post, I think I answered my own question.
ehhhh.... almost
it replaces the
FIRST occurance ' P' with 'P' on
every line of a file.
In order to replace ALL the occurances on all the lines:
:%s / P/P/g