On Wed, 1 Sep 2004 21:21:44 +0100 Ciaran McCreesh wrote: | Currently, we have something like 200 ebuilds which call 'sleep'. How | would people feel about replacing this with an eutils function called | 'epause' (or 'esleep', or 'ezzz', or esitaroundforabit)? Ok, based upon feedback... # Wait for the supplied number of seconds. If no argument is supplied, # defaults to five seconds. If the EPAUSE_IGNORE env var is set, don't # wait. If we're not outputting to a terminal, don't wait. epause() { if [ -z "$EPAUSE_IGNORE" ] && [ -t 1 ] ; then sleep ${1:-5} fi } # Beep the specified number of times (defaults to five). If our output # is not a terminal, don't beep. If the EBEEP_IGNORE env var is set, # don't beep. ebeep() { local n if [ -z "$EBEEP_IGNORE" ] && [ -t 1 ] ; then for ((n=1 ; n <= ${1:-5} ; n++)) ; do echo -ne "\a" sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null echo -ne "\a" sleep 1 done fi } If no-one screams, I'll go ahead with this tomorrow. -- Ciaran McCreesh : Gentoo Developer (Sparc, MIPS, Vim, Fluxbox) Mail : ciaranm at gentoo.org Web : http://dev.gentoo.org/~ciaranm