/ ;+ ; This routine tests the redirection of stdin and stdout ; note that stdin is #inr and stdout is #outr. ; It also tests returned exit status. Functionally it copys ; the standard input to the standard output with ()'s around each ; line. ;- program testf buf: .blkb 80. auto s[84.],i extern $buf$ function main[argc,argv] i := val[.argv[1],10] nbrtxt[#buf,i,1] fprintf "%d = %s" i,#buf ret do forever get[stdin,&s,80] break if r0 ne 1 fprintf "(%s)" &s od ret 5 .end