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

More verbose && ?



Hi all,

I am wondering if there is a way to make && more verbose. Specifically,
I am interested in where it failed in case it does.

Consider this, admittedly crafted, example:


rm dontexist
touch exist
echo yes && cat exist 2>/dev/null && cat dontexist 2>/dev/null && echo no


This will not tell you _where_ it failed, just that it did (and even
that only implicitely via return codes). I would prefer something along
the lines of:


Error executing "echo yes && cat exist 2>/dev/null && cat dontexist
2>/dev/null && echo no": "cat dontexist" failed.

Or just
Error(1): "cat dontexist"


(1) being the, optional, return code being displayed.


Does anyone else think this could be useful?


Thanks,
Richard



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