bash - vim and sed single liner: negate search, multiple search the substituted line, open file and highlight in vim editor -
What I want to do in a row is the following: Output: Works upwards, I do not want the last two letters on the previous line ... ... 2. Illuminate the substitute line searches for inquiries from 'VIM', error The command is thrown down: Error: I think we got what I am trying to achieve, how do I tell BASH through VIM and SED? If you should do it in one line, then: or: This takes your basic operation, but the group uses This problem will run if the last line actually matches dd.dd.ddd (where D represents one digit). If this is a problem, you probably have to use two The first line is absolutely your original order; Second only
1. Search file for lines that do not match a pattern In ak.txt, each line is set to \ & lt; Matches the negation \ & gt; \ | :
\ & lt; Ee integration_01.32.00 \ & gt; \ | \ & LT; Ration_01.2.000 \ & gt; \ | \ & LT; Gon_1.21.000 \ & gt; \ | \ & LT; Dkei_ting-on_1.2.00 \ & gt; \ | \ & Lt; See Integration Instructions & gt; \ |
$ vim -c "/` sed -n '/.* [0-9] [0- 9] \ [0-9] [0- 9] \ [0- 9] [0- 9] [0-9] $ /! S: * *: \\\ & lt; & amp; \\\ & gt; \\\ |: p 'ak .txt` "-C 'set hls' ak.txt
bash :. Unknown history modifier
Sed -n '/.* [0-9] [0-9] \. [0-9] [0-9] \. [0- 9] [0- 9] [0-9] * $ /! {S:. *: \\\ & lt; & Amp; \\\ & gt; \\\ | :; $ S / \\ | $ //; P; } 'Ak.txt
sed -n' /.*[0-9] [0- 0- 9] 9] [ 0- 9] \. [0- 9] \ {3 \} * $ /! {S:. *: \\\ & lt; & Amp; \\\ & gt; \\\ | :; $ S / \\ | $ //; P; } 'Ak.txt
{ and
} for 3 tasks At first your replacement process, unchanged (I had to convert
: to
/ , but did not). The second only matches the last line in the file, and the previous
\ | , which seems to be your primary purpose, prints the third operation line.
sed commands (you can write it on a line, if you want but I do not want to write it on a line): < / P>
sed -n '/.*[0-9] [0-9-9] .. 0-0-9] [0- 0- 9]. ] [0- 9] $ /! S:. *: \\\ & lt; & Amp; \\\ & gt; \\\ |: p 'ak.txt | Sed '$ s / \\ | $ // '
\ | at the end of the last line deletes it.
Comments
Post a Comment