Study for a period of time, feeling in good condition, the teacher said the class can also be remembered, this is learned (note) the 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0071.gif "alt=" J_0071.gif "/>.
In the spirit of the beginning of his mercy, out of the Tao is very simple questions to test their own, not on the machine, handwriting ... It turned out to be tragic
Question 1: There are 3 lines of text that require the exclusion of intermediate lines, showing lines 1th and 3rd
Simulation Environment
[[email protected] tmp]# cat>>a.txt<<eof > aa> bb> cc> eof[[email protected] tmp]# cat A . txt aabbcc#eof can specify any character, try to use EOF, with other needs to avoid the same as the text content caused by unexpected end
idea 1: Eliminate text BB with awk inversion the wrong should not
[[email protected] tmp]# awk ' BB ' a.txt #不要让自己的行为, limiting their thinking [[email protected] tmp]# awk '!/bb/' a.txt aacc[[email protected] tmp]#
Idea 2: Eliminate the second line of text with the SED command
[[Email protected] tmp]# sed '/bb/d ' a.txt aacc# parameters and-n cannot be used at the same time, bastard the buttocks, provisions [[email protected] tmp]# sed-n '/bb/d ' a.txt [email Protected] tmp]#
Idea 3: Exclude text BB with the GREP-V parameter
[Email protected] tmp]# grep-v "BB" a.txt aacc[[email protected] tmp]#
This is basically the case, in the face of the problem, first put forward a solution, and then realize the method
Above his business not to be taken ... don't let the action limit your thoughts . Alas, the foundation is not strong, shake
This article is from the "Neon on the car Window" blog, please be sure to keep this source http://3524436.blog.51cto.com/3514436/1959371
A brief discussion on several methods of simple elimination of strings under Linux (awk, sed, grep)