# This tests the seek command by going through the password file and
# writing to a file called seekout.

proc main
var line st st2 offset

set offset 1
while [trap [set st [open to read "/etc/passwd"]]]; wend
set st2 [open to write "seekout"]
in st
out st2
while 1
	input line
	if $eof; break; endif
	printnl "--" line "--"
	lseek current offset
wend
out "STDOUT"
printnl "DONE"
close st
close st2
endproc
