Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Quoting in zsh -x output



Thanks for looking into this.  Dan, you are correct in your conclusion
that I didn't ask for the original quoting to be preserved, but only
for quoting to be consistent.  The examples I gave in fact confirmed
that.  I hope the patch will go in; thanks for writing it.

Bart, I agree that this patch will not allow pasting of more complex
syntactic constructs.  But that's not the case in Bash either, and I'm
not sure if it's even generally possible with -x.  Being able to
correctly copy one command is already (IMHO) a great thing.

For example, I have a fairly complex script called `reencode' that
accepts simple arguments and uses them to construct the complex
command line with which to call the actual encode utility, `mencoder'.
For debugging and educational purposes, it's useful to see what the
script is doing.  The way I did it is:

    set -x
    mencoder $foo_opts $bar_opts_maybe -o "$dest" "$source" ...
    set +x

With this I get a `make'-like feature of seeing the commands that are
being run.  Full quoting of output brings this to the next level: it
allows me to rerun the command manually, possibly after making a small
adjustment to the options.  `make' doesn't support this, but it's
really neat and very easy to get used to.

Again, thanks for implementing this.



Messages sorted by: Reverse Date, Date, Thread, Author