Re: Display cmd within shell

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

 




> On Jun 11, 2018, at 4:50 PM, Gordon Messmer <gordon.messmer@xxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx/message/MOLX5RD7OXTHNU2RJ37DB6KA4PUONJAK/



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux