bug-bash
[Top][All Lists]
Advanced

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

Re: RFE: capture command AND output for display and/or redirection


From: todd . dsm
Subject: Re: RFE: capture command AND output for display and/or redirection
Date: Sun, 28 Apr 2013 11:01:33 -0700 (PDT)
User-agent: G2/1.0

On Tuesday, April 23, 2013 4:41:04 PM UTC-5, Eric Blake wrote:
> On 04/23/2013 01:07 PM, todd.dsm@gmail.com wrote:
> 
> > Guys, I found the part in the manual about submitting bugs but not requests 
> > for enhancement. If this is not the right place, let me know.
> 
> 
> 
> A missing feature is merely a different form of bug, so yes, this is the
> 
> right place.
> 
> 
> 
> > 
> 
> > Enhancement Request:
> 
> > Bash could use a standardized method of capturing a command AND its output 
> > for display in the terminal and/or redirection (to wherever, file, what 
> > have you).
> 
> 
> 
> 'set -x' is standardized by POSIX, and portable to more than just bash.
> 
>  Additionally, the DEBUG trap can provide you bash-specific additional
> 
> hooks into logging, at the expense of no longer being standardized.
> 
> 
> 
> > 
> 
> > Is this silly = yes. But, I have 2 words to disable any similar arguments: 
> > 'government work'. The white collars may never come around to our way of 
> > thinking, or more appropriately, knowing. Until that happens some goofy 
> > reporting must be used.
> 
> > 
> 
> > echoing a command, then executing is just duplication; also silly. trap is 
> > cool, (EG: trap 'printf %s\\n "$BASH_COMMAND" >&2' DEBUG) - but in the case 
> > of redirection to a file, the variable is first printed literally, then 
> > expanded; this fails too.
> 
> > 
> 
> > Is there any any relief for those working-class scripters like myself?
> 
> 
> 
> Yes, and what you want already exists.
> 
> 
> 
> Read this thread for more details:
> 
> https://lists.gnu.org/archive/html/help-bash/2013-04/msg00031.html
> 
> 
> 
> In particular, that thread points out:
> 
> http://mywiki.wooledge.org/BashFAQ/050
> 
> 
> 
> -- 
> 
> Eric Blake   eblake redhat com    +1-919-301-3266
> 
> Libvirt virtualization library http://libvirt.org



Omitting the set -x from the original post was my error:
1) I wouldn't live without it for debugging purposes. 
2) set x- creates a lot of "noise" on the screen the suites cannot live with.

Is there no foundation for this request to make our lives bit more comfortable?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]