Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Mar 2006 20:43:43 +0200
From:      usleepless@gmail.com
To:        freebsd-questions@freebsd.org
Subject:   Re: Shell ( csh, sh ) scripting and seq-command
Message-ID:  <c39ec84c0603291043u3557ffa9rb4331ba8d3009cd6@mail.gmail.com>
In-Reply-To: <c39ec84c0603290953n2819ef36j30d523537a093827@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

never mind!

#!/bin/csh

if ($#argv == 2) then
        @ start = $argv[1]
        @ end  = $argv[2]
        @ i = $argv[1]

        while ( $i <= $end )
                echo $i
                @ i = $i + 1
        end
endif

if ($#argv == 3) then
        @ start = $argv[1]
        @ end  = $argv[3]
        @ step = $argv[2]
        @ i = $argv[1]

        while ( ($step>0 && $i <= $end) || ($step<0 && $i >= $end) )
                echo $i
                @ i = $i + $step
        end
endif



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c39ec84c0603291043u3557ffa9rb4331ba8d3009cd6>