File:  [Research Unix] / researchv10dc / cmd / icon / ipl / source / trim.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

#	TRIM
#
#	Trim lines
#
#	Ralph E. Griswold
#
#	Last modified 7/10/83
#

procedure main(x)
   local n, i, pad, s, line
   n := 80
   pad := 0
   i := 0
   while i < *x do {
      s := x[i +:= 1] | break
      if s == "-f" then pad := 1
      else if not(n := (0 <= integer(s))) then stop("usage: trim [n] [-f]")
      }
   while line := read() do {
      line := line[1+:n]
      line := trim(line)
      if pad = 1 then line := left(line,n)
      write(line)
      }
end

unix.superglobalmegacorp.com

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