bash snippet: dumping function call trace
Posted on Mon 18 July 2011 in Hacks • Tagged with bash, debugging, script • Leave 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 ...