bash snippet: dumping function call trace

Posted on Mon 18 July 2011 in Hacks • Tagged with bash, debugging, scriptLeave a comment

Uno snippet di codice bash utile nel debugging di script.

#@.. function:: __cm_exit_error([text],[...])
#@
#@   Stampa la stringa passata in stderr ed esce
#@   Se รจ impostata la variabile __cm_debug stampa lo stack di chiamata delle funzioni
#@
#@   :param text: la stringa da stampare
#@   :type text: String
#@
__cm_exit_error()

{
        echo "Error in ${FUNCNAME[1]}:${BASH_LINENO ...
Continue reading