home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / LIBC / LIBC-4.6 / LIBC-4 / libc-linux / nls / linux / extract next >
Encoding:
Text File  |  1993-11-24  |  670 b   |  20 lines

  1. #!/bin/sh
  2. # Take a list of one line messages and output format for
  3. # message file. Use only for static structures because
  4. # position depencency is required. Otherwise make message
  5. # id's more informative for use (i.e. hand edit)
  6. # I used this for _errlist.c, _siglist.c.  - Mitch
  7. # Its not as clever as I'd like it to be :-(
  8.  
  9. # NOTE: Gawk-2.15.3 broke the RLENGTH return from match().
  10. # So please use the lex version of this called `xtract'. Just type
  11. #     % make xtract 
  12. # in this directory.
  13.  
  14. gawk '(/\".*\"/) && ($1 !~ /#/) { \
  15.         match($0,/\".*\"/);
  16.         str = substr($0,RSTART+1,RLENGTH-2); \
  17.         if (str)
  18.         printf("$ #%d Original Message:(%s)\n# %s\n",x++,str,str)}' "$*"
  19.  
  20.