[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

codigo de retorno



Dae pessoal!

Qual o valor máximo de codigo de retorno (return status) de uma funçao em
bash? 

Fiz uma funcao fat () em bash mas ela só retorna valores menores que 1000 e
pouco... o unico modo de pegar o retorno é deste jeito aí em baixo?

-- corta --

#!/bin/bash
fat () {
        if [[ $1 = 1 || $1 = 0 ]] ; then
                return 1;
        fi

        fat $(($1 - 1))
        return $(($1 * $?))
} 

fat $1
echo $?

-- corta --

abraços
T Vignatti



Reply to: