1. flow control
sed support simple flow control
use the keyword "b" to jump to a label,and beware of where you put the label.
2. the use of N
when sed see a N, it reads the next line into the pattern buffer.
then you can do substitute,delete with the pattern buffer.
the following code combines 2 lines into one as long as the first one ends with ";"
3. the usage of NF
you have to add a '$' sign ahead of NF under HP-UX,otherwise you will never get what you want.
阅读(961) | 评论(0) | 转发(0) |