Description
In the following example, we want to 'move' all the lines containing
'this' to the end of a file, i.e., display lines not containing
'this' first.
|
| Raw Input
|
| Desired Output
| 1 this
2 this
3 another
4 another
5 this
6 another
7 this
8 another
9 this
|
| 3 another
4 another
6 another
8 another
1 this
2 this
5 this
7 this
9 this
|
|
Script and Comments
Script1 [ 1] /this/H
[ 2] /this/!p
[ 3] $!d
[ 4] x
[ 5] s/^\n//
[ 6] /^$/d
| |