bash debug tips. semi OT

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

 



Hello all

this is a question about debuging bash scripts. I think this is a semi off
topic because its not a red hat question ... but I´m sure all of us have an
answer to this question.

I have several scripts  with echo commands to check variable values

the code I use is like this

if [ ! -z $DEBUG ]; then
    echo "variable: $variable"
fi

thus If I set DEBUG=on I get a lot messages with the variable values.

My question is if is there any tip to do this without using the if code
snipet (something like an inline function...)

on the other hand any tip about debugging bash scripts is welcome (like
setting option flags -n, -v o -x)

Greetings

ESG
-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subjecthttps://www.redhat.com/mailman/listinfo/redhat-list


[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux