nextserial reads the soafile file for a line containing the (regular expression) pattern "Serial". This line is assumed to be the line containing the SOA Serial number. The number is read from the line and incremented. The line is then written with the new serial number. All other lines are put through unchanged.
Given the soafile for our domain (wr.tek.com):
@ IN SOA wrgate.wr.tek.com. wrap.wrgate.wr.tek.com. ( 1 ; Serial 3600 ; Refresh 300 ; Retry 3600000 ; Expire 14400 ) ; Minimum IN NS wrgate.wr.tek.com.
Running nextserial soafile would result in the soafile looking like:
@ IN SOA wrgate.wr.tek.com. wrap.wrgate.wr.tek.com. ( 2 ; Serial 3600 ; Refresh 300 ; Retry 3600000 ; Expire 14400 ) ; Minimum IN NS wrgate.wr.tek.com.