Path: utzoo!utgpu!watserv1!watmath!uunet!bu.edu!bu-cs!snorkelwacker!mintaka!ogicse!reed!trost From: trost@reed.bitnet (Bill Trost,Box 607,ext 640,) Newsgroups: gnu.bash.bug Subject: Re: questions re bash-1.04 Message-ID: <14088@reed.UUCP> Date: 7 Feb 90 01:00:44 GMT References: <1510@ursa-major.SPDCC.COM> Sender: news@reed.UUCP Lines: 24 In message <1510@ursa-major.SPDCC.COM>, lj@ursa-major.spdcc.COM (Len Jacobs) writes: .... >Is there a bash equivalent to the csh "repeat" command? Excluding oddities in the behavior of csh (involving redirecting, job control, and the like), this should do the job. I've found the oddities of csh to be non-intuitive anyhow. Awk doesn't seem right for this, but I'm being lazy and it was the only thing I could think of that is commonly available. A calculator program should do the job; a C program would be easy enough (and useful in its own right). repeat () { local count count=$1 shift for i in `awk 'BEGIN { for (i = 1; i <= '$count'; i++) print i }' < /dev/null` do $* # use "$@" in bash 1.05 and later done }