home *** CD-ROM | disk | FTP | other *** search
/ ftp.uni-stuttgart.de/pub/systems/acorn/ / Acorn.tar / Acorn / riscos / problems / gawk / killcr.text next >
Text File  |  1992-01-08  |  388b  |  8 lines

  1. if "%0"="" then echo syntax killcr outputfile inputfile
  2. if "%0"="" then echo 
  3. if "%0"="" then error 0 name of outputfile and inputfile needed
  4. if "%1"="" then error 0 name of inputfile needed
  5. type %1 -tabexpand { > /dev/temp }
  6. gawk -v outfile="%0" "BEGIN {f=0;} /^/ { if (f==1) {x=substr($0,2); printf(\"%s\n\",x) > outfile; } else {printf(\"%s\n\",$0) > outfile;f=1;} }" /dev/temp 
  7. *quit
  8.