Re: simple function causes BASH to exit when -e in effect

2017-12-24 Thread Kevin Layer
Bob, 'set -e' is a double-edged sword, for sure, but I'm not sure it creates more problems than it solves. Hidden non-zero exits have wasted far more time, for me, than this little exercise has. On Sun, Dec 24, 2017 at 11:45 AM, Bob Proulx wrote: > Kevin Layer wrote: >

Re: simple function causes BASH to exit when -e in effect

2017-12-22 Thread Kevin Layer
e: > > > On Fri, Dec 22, 2017 at 1:39 PM, Kevin Layer wrote: > >> The bug happens to me on >> GNU bash, version 4.1.2(2)-release (x86_64-redhat-linux-gnu) >> and >> GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.4.0) >> >> The script is

simple function causes BASH to exit when -e in effect

2017-12-22 Thread Kevin Layer
The bug happens to me on GNU bash, version 4.1.2(2)-release (x86_64-redhat-linux-gnu) and GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.4.0) The script is attached, but the function in question is this: function debug1 { [ "$debug" ] && echo "$(date "+%Y-%m-%d %H:%M:%S"): $@" }