File:  [Research Unix] / researchv10dc / cmd / icon / ipl / source / lam.icn
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 3 months ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross

#	LAM
#
#	Laminate files
#
#	Thomas R. Hicks
#
#	Last modified 2/1/86 by Ralph E. Griswold
#

global fndxs

procedure main(a)
   local bufs, i
   bufs := list(*a)
   fndxs := []
   if (*a = 0) | a[1] == "?" then Usage()
   every i := 1 to *a do {
      if a[i] == "-" then {
         a[i] := &input
            put(fndxs,i)
            }
      else if match("-",a[i]) then {
         bufs[i] := a[i][2:0]
         a[i] := &null
         }
      else {
         if not (a[i] := open(a[i])) then
            stop("Can't open ",a[i])
         else put(fndxs,i)
         }
     }
   if 0 ~= *fndxs then lamr(a,bufs) else Usage()
end

procedure lamr(args,bufs)
   local i, j
   every i := !fndxs do
      bufs[i] := (read(args[i]) | &null)
   while \bufs[!fndxs] do {
      every j := 1 to *bufs do
         writes(\bufs[j])
      write()
      every i := !fndxs do
         bufs[i] := (read(args[i]) | &null)
     }
end

procedure Usage()
   stop("usage: lam file [file | -string]...")
end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.