home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / wp_dtp / ghostscr.lha / bin / uniq.rexx
OS/2 REXX Batch file  |  1993-01-10  |  388b  |  26 lines

  1. /* uniq: 
  2.  *     read standard input and process arguments to standard output. Ignore
  3.  *    multiple occurences of the same string appearing in sequence. 
  4.  *
  5.  *  Example:
  6.  *        file foo: contains:
  7.  *            dog
  8.  *            dog
  9.  *            cat
  10.  *
  11.  *        rx uniq < foo produces:
  12.  *            dog
  13.  *            cat
  14.  */
  15.  
  16. lastarg = ""
  17.  
  18. parse pull arg
  19.  
  20. do while arg ~= ""
  21.     if arg ~= lastarg then
  22.         say arg
  23.     lastarg = arg
  24.     parse pull arg
  25. end
  26.