home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume34 / fsp / part04 / fcatcmd.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-18  |  1.2 KB  |  47 lines

  1.     /*********************************************************************\
  2.     *  Copyright (c) 1991 by Wen-King Su (wen-king@vlsi.cs.caltech.edu)   *
  3.     *                                                                     *
  4.     *  You may copy or modify this file in any manner you wish, provided  *
  5.     *  that this notice is always included, and that you hold the author  *
  6.     *  harmless for any loss or damage resulting from the installation or *
  7.     *  use of this software.                                              *
  8.     \*********************************************************************/
  9.  
  10. #include "client_def.h"
  11.  
  12. extern char **glob();
  13.  
  14. static void dont_die(){}
  15.  
  16. static get_file(path)
  17.     char *path;
  18. {
  19.     char *name, *t2;
  20.     FILE *fp;
  21.  
  22.     for(name = t2 = path; *t2; t2++) if(*t2 == '/') name = t2 + 1;
  23.     util_download(path,stdout);
  24. }
  25.  
  26. main(argc,argv,envp)
  27.     int argc;
  28.     char **argv,**envp;
  29. {
  30.     char **av, *av2[2];
  31.  
  32.     env_client();
  33.  
  34.     signal(SIGPIPE,dont_die);
  35.     if(isatty(1)) client_trace = 0;
  36.  
  37.     while(*++argv)
  38.     {
  39.     if(!(av = glob(*argv))) { av = av2; av2[0] = *argv; av2[1] = 0; }
  40.     while(*av) get_file(*av++);
  41.     }
  42.  
  43.     client_done();
  44.  
  45.     exit(0);
  46. }
  47.