Re: bash giving wrong message for indicated failure (was Re: Unhelpful behaviors in 4.2.10(1))

2012-06-14 Thread Linda Walsh
Chet Ramey wrote: That's fine -- if the error message points at the included file as "not returning a > 'true' value. It doesn't. It points to a conditional in the previous file. Note that the error message wasn't generated by bash: you generated it yourself based on $BASH_COMMAND and the

Re: bash giving wrong message for indicated failure (was Re: Unhelpful behaviors in 4.2.10(1))

2012-06-14 Thread Chet Ramey
> > That's fine -- if the error message points at the included file as "not > > returning a > 'true' value. > > > > It doesn't. It points to a conditional in the previous file. Note that the error message wasn't generated by bash: you generated it yourself based on $BASH_COMMAND and the various

Re: bash giving wrong message for indicated failure (was Re: Unhelpful behaviors in 4.2.10(1))

2012-06-13 Thread Linda Walsh
Reference original problem: - Begin File1 (sdf) #!/bin/bash _prgpth="${0:?}"; _prg="${_prgpth##*}"; _prgdr="${_prgpth%/$_prg}" [[ -z $_prgdr || $_prg == $_prgdr ]] && $_prgdr="$PWD" export PATH="$_prgdr

Re: Unhelpful behaviors in 4.2.10(1)

2012-06-09 Thread Linda Walsh
Chet Ramey wrote: On 6/9/12 3:05 AM, Linda Walsh wrote: To sum up ". sdf2" is returning 1 Bash considers . to be a simple command even though what's really executed is [[ $# -ge 2 ]] && echo hello. --- Right It's NOT a simple command. To be clear: `.' is a shell builtin, with its

Re: Unhelpful behaviors in 4.2.10(1)

2012-06-09 Thread Chet Ramey
On 6/9/12 3:05 AM, Linda Walsh wrote: > >> To sum up ". sdf2" is returning 1 >> Bash considers . to be a simple command even though what's really >> executed is [[ $# -ge 2 ]] && echo hello. > --- > Right It's NOT a simple command. To be clear: `.' is a shell builtin, with its own seman

Re: Unhelpful behaviors in 4.2.10(1)

2012-06-09 Thread Pierre Gaston
On Sat, Jun 9, 2012 at 10:05 AM, Linda Walsh wrote: > > > Pierre Gaston wrote: >> >> >>> trap backtrace ERR >>> set -T >>> >> >> To sum up ". sdf2"  is returning 1 >> Bash considers . to be a simple command even though what's really >> executed is [[ $# -ge 2 ]] && echo hello. > > --- >        Rig

Re: Unhelpful behaviors in 4.2.10(1)

2012-06-09 Thread Linda Walsh
Pierre Gaston wrote: trap backtrace ERR set -T To sum up ". sdf2" is returning 1 Bash considers . to be a simple command even though what's really executed is [[ $# -ge 2 ]] && echo hello. --- Right It's NOT a simple command. I am trapping on ERR, not 'anything' that

Re: Unhelpful behaviors in 4.2.10(1)

2012-06-08 Thread Pierre Gaston
On Sat, Jun 9, 2012 at 4:01 AM, Linda Walsh wrote: > File1: > sdf: > Ishtar:/tmp> more sdf > #!/bin/bash > > _prgpth="${0:?}"; _prg="${_prgpth##*}"; _prgdr="${_prgpth%/$_prg}" > [[ -z $_prgdr || $_prg == $_prgdr ]] && $_prgdr="$PWD" > export PATH="$_prgdr/lib:$_prgdr:$PATH" > shopt -s expand_alias

Unhelpful behaviors in 4.2.10(1)

2012-06-08 Thread Linda Walsh
File1: sdf: Ishtar:/tmp> more sdf #!/bin/bash _prgpth="${0:?}"; _prg="${_prgpth##*}"; _prgdr="${_prgpth%/$_prg}" [[ -z $_prgdr || $_prg == $_prgdr ]] && $_prgdr="$PWD" export PATH="$_prgdr/lib:$_prgdr:$PATH" shopt -s expand_aliases extglob sourcepath ; set -o pipefail . backtrace.shh . sdf2 ---