From owner-freebsd-questions@FreeBSD.ORG Wed Mar 29 20:16:22 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 742A716A400 for ; Wed, 29 Mar 2006 20:16:22 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0EFF843D4C for ; Wed, 29 Mar 2006 20:16:21 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.4) id k2TKGGMr023834; Wed, 29 Mar 2006 14:16:16 -0600 (CST) (envelope-from dan) Date: Wed, 29 Mar 2006 14:16:16 -0600 From: Dan Nelson To: usleepless@gmail.com Message-ID: <20060329201616.GA42429@dan.emsphone.com> References: <20060329135713.cec7dbd1.wmoran@collaborativefusion.com> <20060329142754.a7488302.wmoran@collaborativefusion.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.5-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 Cc: freebsd-questions@freebsd.org, Bill Moran Subject: Re: Shell ( csh, sh ) scripting and seq-command X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2006 20:16:22 -0000 In the last episode (Mar 29), usleepless@gmail.com said: > > You > > should be able to write a shell script > > as i stated in my message, i lack shell scripting experience. > > > that wraps jot and provides > > its functionality in the same format as seq. > > yes, and to convert steps to reps you will need $reps = ($end - > $start) / $steps, and then see the difference between your script and > the output of an actual linux seq. > > for example: > seq 1 2 60 gives 1..3..5..7..59 ( see also my php and csh implementations ) > > a seq equivalent ( 3 par version ) would be: > > @ reps = ( $3 - $1 ) / $2 > jot $reps $1 $3 > > which will give 1..3..5..7..9..12(!)..zzzz..60 > > so how would your implementation of seq by using jot look like? jot - $1 $3 $2 ( which in your case would be "jot - 1 60 2" ) -- Dan Nelson dnelson@allantgroup.com