From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from minster.york.ac.uk ([144.32.128.41]) by hawkwind.utcs.toronto.edu with SMTP id <2772>; Wed, 7 Jul 1993 11:02:41 -0400 From: mhw@minster.york.ac.uk Date: Wed, 7 Jul 1993 12:01:15 -0400 Message-ID: >From: Mark H. Wilkinson Subject: sam -r * To: sam-fans@hawkwind.utcs.toronto.edu Illegal-Object: Syntax error in Sender: address found on hawkwind.utcs.toronto.edu: Sender: Mark H.Wilkinson ^ ^-illegal period in phrase \-phrases containing '.' must be quoted X-Mailer: Sendmail/ream v4.12bv I've always found it strange that ``sam -r machine'' was mutually exclusive with ``sam [option ...] [files].'' A quick look at the source revealed that it could easily be changed to allow the -r option to pass the list of files to sam on the remote machine. Here's the patch: diff -C 2 -r old.sam/sam/io.c new.sam/sam/io.c *** old.sam/sam/io.c Wed Jul 7 13:34:43 1993 --- new.sam/sam/io.c Wed Jul 7 15:44:21 1993 *************** *** 215,221 **** void ! connectto(char *machine) { int p1[2], p2[2]; if(pipe(p1)<0 || pipe(p2)<0){ --- 215,222 ---- void ! connectto(char *machine, int fargc, char **fargv) { int p1[2], p2[2]; + char **nargv, **fp, **tp; if(pipe(p1)<0 || pipe(p2)<0){ *************** *** 227,230 **** --- 228,239 ---- switch(fork()){ case 0: + tp = nargv = emalloc((4+fargc)*sizeof(char *)); + *tp++ = RX; + *tp++ = machine; + *tp++ = rsamname; + *tp++ = "-R"; + fp = fargv; + while (*tp++ = *fp++) + ; dup(p2[0], 0); dup(p1[1], 1); *************** *** 233,237 **** close(p2[0]); close(p2[1]); ! execl(RXPATH, RX, machine, rsamname, "-R", (char*)0); dprint("can't exec %s\n", RXPATH); exits("exec"); --- 242,246 ---- close(p2[0]); close(p2[1]); ! exec(RXPATH, nargv); dprint("can't exec %s\n", RXPATH); exits("exec"); *************** *** 246,253 **** void ! startup(char *machine, int Rflag, char **argv, char **end) { if(machine) ! connectto(machine); if(!Rflag) bootterm(machine, argv, end); --- 255,262 ---- void ! startup(char *machine, int Rflag, char **argv, char **end, int fargc, char **fargv) { if(machine) ! connectto(machine, fargc, fargv); if(!Rflag) bootterm(machine, argv, end); diff -C 2 -r old.sam/sam/sam.c new.sam/sam/sam.c *** old.sam/sam/sam.c Wed Jul 7 13:35:03 1993 --- new.sam/sam/sam.c Wed Jul 7 15:28:01 1993 *************** *** 95,99 **** home = "/"; if(!dflag) ! startup(machine, Rflag, arg, ap); Fstart(); notify(notifyf); --- 95,99 ---- home = "/"; if(!dflag) ! startup(machine, Rflag, arg, ap, argc, argv); Fstart(); notify(notifyf); diff -C 2 -r old.sam/sam/sam.h new.sam/sam/sam.h *** old.sam/sam/sam.h Wed Jul 7 13:35:05 1993 --- new.sam/sam/sam.h Wed Jul 7 15:30:18 1993 *************** *** 286,290 **** void snarf(File*, Posn, Posn, Buffer*, int); void sortname(File*); ! void startup(char*, int, char**, char**); void state(File*, int); int statfd(int, ulong*, ulong*, long*, long*); --- 286,290 ---- void snarf(File*, Posn, Posn, Buffer*, int); void sortname(File*); ! void startup(char*, int, char**, char**, int, char**); void state(File*, int); int statfd(int, ulong*, ulong*, long*, long*);