Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: seq from core utils




On Dec 5, 2004, at 21.09, Ross McKerracher wrote:

Hi,

I have some BASH scripts that I used to use on a linux box. Most of them work well on OS X, except for the ones that require the "seq" command. I can't seem to find any information on how to download the source or binaries for this command.

I have poked around the web (including fink) and can't see any obvious way to obtain just the seq command for my os X box. I don't want play around with the standard shell distro any more than I absolutely have to.

Any ideas anyone?


I have also been burned by this one. I added a quick function to /etc/profile that adds seq functionality as a built-in function to all shells -- I have extended seq to take an optional 3rd parameter which is the skip or increment.

# Usage : seq n m [i]
# echo all integers between n and m using a skip or increment of i
seq ()
{
    local x=$1;
    local y=$2;
    local i=${3:-1};
    while [ $x -le $y ]; do
        echo -n $x' ';
        x=$(( $x + $i ));
    done
}


-- a l a n a t p o l y p h a s e d o t c a

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/email@hidden

This email sent to email@hidden
References: 
 >seq from core utils (From: Ross McKerracher <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.