On Sun, Nov 09, 2008 at 04:29:31PM +0100, Petr Rockai wrote:
> Anyhow, let me propose a different solution to the "yes" problem.
> Since we can't use "yes" in shell tests, I'd propose adding a
> "yes" implementation (that would be in the default test PATH)
> that always returns 1 and prints to stderr "Sorry, we cannot use
> 'yes' in test scripts, as this breaks on MacOS X". Would that
> work? Takers for implementation?

I'm not sure wether I'm understanding the problem correctly (I
didn't the complete thread), but if all you need is a yes for a
shell script when there's no yes(1) is installed, you could just
use a small function:

yes() {
        local x=$1
        x=${x:=y}
        while :; do; echo "$x" done
}


Or if you just need to create some output (as seems to be the case
in issue1017_whatsnew_stack.sh):

typeset -i x
x=4000
while [ $x -gt 0 ]; do
        echo y
        let x--
done > foo

Ciao,
        Kili
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to