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

Re: More verbose && ?



On Wed, Jan 20, 2010 at 18:10, Stephane Chazelas
<stephane_chazelas@xxxxxxxx> wrote:

> r() { last_run_command=${(j: :)*}; "$@"; }
> report() {
> Âexit_code=$?
> Âprintf >&2 'Error(%d): "%s"\n' "$exit_code" "$last_run_command"
> Âreturn "$exit_code"
> }

That works just as expected, but for two things:

1) I need to run `report`
2) It does not work on the unaltered command I posted in my initial
   email.

I would definitely prefer an invisible and automagic way, ideally activated
via an option.



Thanks,
Richard



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