brian@galah.aso.hp.com (Brian Coogan) (01/12/90)
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; } }