z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Specifying a range of lines to change

z/OS UNIX System Services User's Guide
SA23-2279-00

You can also apply s to a range of lines. For example, let's examine the command:
:1,200s/^/!/
What happens? The 1,200 in front of the s indicates that the command should be applied to the lines from 1 through 200 (everything up to the 200th line in the file). The s command itself says to replace the beginning of the line (^) with an exclamation point. So an exclamation point would be put at the beginning of every line up to number 200. To get rid of the exclamation points, you would type:
:1,200s/^!//
which says change every ! at the beginning of a line to nothing.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014