d$! DO SED {file {$}} $! Simple file editor, The commands are /{cmd}{num} ,$! $! //{n} Show the file, {or n-th line} and move as appropriate. $! /D{n} Delete the current {n-th} line X$! /I{n} Insert a line before the current {n-th} line $! /WR Exit from the procedure, writing to the file. $! ^C Exit from the procedure, not writing the file $! $! The modifier {$} causes the file not to be opened. L$! $!-end.of.info- $ x$ outname := OUTFILE $ if( p1.nes."" ) then outname := 'p1 @$ if( p1.eqs."" ) then inquire p1 "File <.dat>" $ $ line := l$ endl=0 !!End line $ fstl=1 !!First line 4$ curl=1 !!Current line $ if( p2.eqs."$" ) then goto nofile $ open/read/err=nofile infil 'p1 ` $ $readnx: ( $ read/end=edfil infil line'curl $ endl = curl $ curl = curl+1 T $ goto readnx $  $edfil: $ close infil $ goto showall H $ !!!!!!! $ $nofile: t$ line := "" $ <$nxline: $ on error then goto nxline $ if( curl.le.endl ) then write sys$output " ",curl,"/ ",line'curl h$ inquire line " "'curl' $ if( "''f$extract(0,1,line)'".eqs."/" ) then goto yescmd 0$ line'curl := "''line'" $ if( curl.gt.endl ) then endl = curl $down: \$ if( curl.le.endl ) then curl = curl+1 $ goto nxline $$!!!!!! $ $yescmd: P$ if( line.eqs."/WR" ) then goto finsed $ fst := 'f$extract(0,2,line) $ innum := 'f$extract(2,100,line) |$ curtem = curl $ if(innum.nes."" ) then curl = innum D$ if( curl.gt.endl+1 ) then curl=endl+1 $ if( fst.eqs."/D" ) then goto dellin $ if( fst.eqs."/I" ) then goto inslin p$ if( fst.eqs."/M" ) then goto down $ if( fst.eqs."//" ) then goto sholin 8$ @SCI_COM:info sed $ goto nxline $!!!!!! d$ $sholin: ,$ if(innum.nes."" ) then goto nxline $ $showall: X$ curl = 1 $ $nxshow: $ if(curl.gt.endl) then goto nxline $ write sys$output " ",curl," ",line'curl L$ curl = curl+1 $ goto nxshow $!!!!! x$ $dellin: @$ teml = curl $ if(curl.ge.endl) then goto nxline  $ l $delnex: $ nxlin = teml+1 4!$ if(teml.ge.endl) then goto delfin !$ assign &line'nxlin SCI_TEMP !$ line'teml := 'f$logical("SCI_TEMP") `"$ deass SCI_TEMP "$ teml = teml+1 (#$ goto delnex #$ #$delfin: T$$ endl = endl-1 $$ goto nxline %$!!!!! %$ %$inslin: H&$ teml = endl &$ '$insnex: t'$ nxlin = teml+1 '$ if(teml.lt.curl) then goto insfin <($ assign &line'teml SCI_TEMP ($ line'nxlin := 'f$logical("SCI_TEMP") )$ deass SCI_TEMP h)$ teml = teml-1 )$ goto insnex 0*$ *$insfin: *$ endl = endl+1 \+$ line'curl := +$ goto nxline $,$!!!!! ,$ ,$ P-$finsed: -$ if( p2.eqs."" ) then open/write 'outname 'p1 .$ fstl = 1 !!First line to be written |.$ .$nxwrit: D/$ write 'outname line'fstl /$ fstl = fstl+1 0$ if( fstl.le.endl ) then goto nxwrit p0$ 0$ if( p2.eqs."" ) then close 'outname 81$ exit 1$