Shell ( csh, sh ) scripting and seq-command

usleepless at gmail.com usleepless at gmail.com
Wed Mar 29 19:50:59 UTC 2006


> 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?

regards,

usleep


On 3/29/06, Bill Moran <wmoran at collaborativefusion.com> wrote:
> On Wed, 29 Mar 2006 21:13:24 +0200
> usleepless at gmail.com wrote:
>
> > jot != seq
>
> Equivalent, no.  But it does offer comparative functionality.  You
> should be able to write a shell script that wraps jot and provides
> its functionality in the same format as seq.
>
> --
> Bill Moran
> Collaborative Fusion Inc.
>


More information about the freebsd-questions mailing list