From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from plan9.research.att.com ([135.205.33.187]) by hawkwind.utcs.utoronto.ca with SMTP id <24660>; Sat, 3 May 1997 14:35:48 -0400 From: rsc@research.att.com Date: Sat, 3 May 1997 08:43:33 -0400 To: culliton@clark.net, rc@hawkwind.utcs.toronto.edu Subject: Re: Speaking of counting... Message-Id: <97May3.143548edt.24660@hawkwind.utcs.utoronto.ca> #!/bin/rc first=0 last=0 incr=0 switch($#*) { case 0 echo 'Usage: $0 [first [incr]] last' exit 1 case 1 last=$1 case 2 first=$1 last=$2 case 3 first=$1 incr=$2 last=$3 } awk -v 'first='$first -v 'last='$last -v 'incr='$incr 'BEGIN{ if(incr == 0) incr = 1; if(first == 0) first = 1; for(i = first; i <= last; i += incr) print i; }' ------ forwarded message follows ------ >From hawkwind.utcs.toronto.edu!rc-owner Fri May 2 19:49:49 EDT 1997 Received: from corona.research.att.com by plan9; Fri May 2 19:49:49 EDT 1997 Received: from research.att.com (research.research.att.com [135.205.32.20]) by corona.research.att.com (8.7.5/8.7) with SMTP id TAA29692 for ; Fri, 2 May 1997 19:50:01 -0400 (EDT) Received: from hawkwind.utcs.utoronto.ca ([128.100.102.51]) by research; Fri May 2 19:48:54 EDT 1997 Received: from mail.clark.net ([168.143.0.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24662>; Fri, 2 May 1997 19:45:47 -0400 Received: from clark.net (culliton@explorer.clark.net [168.143.0.7]) by mail.clark.net (8.8.5/8.6.5) with ESMTP id SAA17772; Fri, 2 May 1997 18:08:51 -0400 (EDT) From: Tom Culliton Received: (from culliton@localhost) by clark.net (8.8.5/8.7.1) id SAA16770; Fri, 2 May 1997 18:09:14 -0400 (EDT) Date: Fri, 2 May 1997 18:09:14 -0400 Message-Id: <199705022209.SAA16770@clark.net> To: hawkwind.utcs.toronto.edu!rc Cc: LoVerso.Southborough.MA.US!john, osf.org!rsalz Subject: Re: Speaking of counting... So far jot and seq have been mentioned, (every machine I have available says "jot not found" though... and ditto seq) but no specifics, I have been accused of wanting to reinventing the wheel, (exactly what I was trying to avoid) Scott has shared some perl code, (Euw! The evil anit-rc!) ;-) (Thank you.) I swear I've seen this in rc/awk before...