home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / fsp / part01 / fcatcmd.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-12  |  1.1 KB  |  45 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. dont_die(){}
  14.  
  15. main(argc,argv,envp)
  16.     int argc;
  17.     char **argv,**envp;
  18. {
  19.     char **av, *av2[2];
  20.  
  21.     env_client();
  22.  
  23.     signal(SIGPIPE,dont_die);
  24.  
  25.     while(*++argv)
  26.     {
  27.     if(!(av = glob(*argv))) { av = av2; av2[0] = *argv; av2[1] = 0; }
  28.     while(*av) get_file(*av++);
  29.     }
  30.  
  31.     client_done();
  32.  
  33.     exit(0);
  34. }
  35.  
  36. get_file(path)
  37.     char *path;
  38. {
  39.     char *name, *t2;
  40.     FILE *fp;
  41.  
  42.     for(name = t2 = path; *t2; t2++) if(*t2 == '/') name = t2 + 1;
  43.     util_download(path,stdout);
  44. }
  45.