Path: utzoo!attcan!uunet!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!ucsd!ucsdhub!hp-sdd!hplabs!hpda!hpcuhc!hpausla!galah!brian From: brian@galah.aso.hp.com (Brian Coogan) Newsgroups: comp.lang.perl Subject: eg/g/gsh needs a fix with 3.0 Message-ID: <4080003@galah.aso.hp.com> Date: 12 Jan 90 07:27:50 GMT Organization: HP Australian Software Operation Lines: 51 gsh needs the shift inside the sub switches changed to shift(@ARGV) or it loops forever if you give a switch. The g tools are neat stuff, check them out if you administer a lan. Patch enclosed (only minimally tested). Brian Coogan, Hewlett-Packard Australian Software Operation. --------------------------------- *** Orig/gsh Mon Nov 13 18:52:41 1989 --- eg/g/gsh Fri Jan 12 18:12:31 1990 *************** *** 1,4 **** ! #!/bin/perl # $Header: gsh,v 3.0 89/10/18 15:14:36 lwall Locked $ --- 1,4 ---- ! #! /usr/bin/perl # $Header: gsh,v 3.0 89/10/18 15:14:36 lwall Locked $ *************** *** 8,18 **** sub getswitches { while ($ARGV[0] =~ /^-/) { # parse switches ! $ARGV[0] =~ /^-h/ && ($showhost++,$silent++,shift,next); ! $ARGV[0] =~ /^-s/ && ($silent++,shift,next); ! $ARGV[0] =~ /^-d/ && ($dodist++,shift,next); ! $ARGV[0] =~ /^-n/ && ($n=' -n',shift,next); ! $ARGV[0] =~ /^-l/ && ($l=' -l ' . $ARGV[1],shift,shift,next); last; } } --- 8,19 ---- sub getswitches { while ($ARGV[0] =~ /^-/) { # parse switches ! $ARGV[0] =~ /^-h/ && ($showhost++,$silent++,shift(@ARGV),next); ! $ARGV[0] =~ /^-s/ && ($silent++,shift(@ARGV),next); ! $ARGV[0] =~ /^-d/ && ($dodist++,shift(@ARGV),next); ! $ARGV[0] =~ /^-n/ && ($n=' -n',shift(@ARGV),next); ! $ARGV[0] =~ /^-l/ && ($l=' -l ' . $ARGV[1],shift(@ARGV),shift(@ARGV), ! next); last; } }