home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume12 / cake / part09 / Script / yyrepl < prev    next >
Encoding:
Text File  |  1987-10-15  |  424 b   |  28 lines

  1. #! /bin/csh -f
  2. cat > /tmp/yyrepl1$$ << END_PROG
  3. BEGIN        {
  4.             found = 0;
  5.         }
  6. /^YYREPL/    {
  7.             if (NF < 3)
  8.                 next;
  9.  
  10.             found = 1;
  11.             printf "gres yy %s\n", \$2;
  12.             printf "gres YY %s\n", \$3;
  13.             exit;
  14.         }
  15. END        {
  16.             if (found == 0)
  17.                 printf "gres yy yy\n";
  18.         }
  19. END_PROG
  20. awk -f /tmp/yyrepl1$$ $1 > /tmp/yyrepl2$$
  21. ex - /tmp/yyrepl2$$ << END
  22. %s/\$/ $argv[2-]/g
  23. w
  24. q
  25. END
  26. source /tmp/yyrepl2$$
  27. /bin/rm /tmp/yyrepl1$$ /tmp/yyrepl2$$
  28.