> On Jun 11, 2018, at 4:50 PM, Gordon Messmer <gordon.mess...@gmail.com> wrote:
> 
> On 06/11/2018 02:31 PM, Bev in TX wrote:
>> 
>> It’s an option of the builtin set command.
>> 
>> set …
>> … When  options  are  specified,  they set or unset shell attributes. ….
>> -v      Print shell input lines as they are read.
> 
> Yeah, that also *kinda* works.  That'll print lines as they're read, not as 
> they're executed, so you *do* get the lines before expansion, but you won't 
> get quiet what is expected (I think) if those lines appear in a loop or a 
> function.
> _______________________________________________


It may not be perfect, but it helps in many situations.  

I set a debug flag in my main script (often passed as a script argument, e.g., 
myscript -d).  That flag can be checked in loops and/or passed to functions.  
If the flag is set I then execute set -x or whichever form is desired.  This 
way I have a form of debugging built into the script at all times, but it has 
little impact production usage.
  
Bev in TX



_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/message/MOLX5RD7OXTHNU2RJ37DB6KA4PUONJAK/

Reply via email to