Files
bash/tests/cond-error1.sub
T
2024-04-25 15:50:39 -04:00

29 lines
559 B
Plaintext

: ${THIS_SH:=./bash}
# all parse errors
${THIS_SH} -c '[[ ( -n xx' bash
${THIS_SH} -c '[[ ( -n xx )' bash
${THIS_SH} -c '[[ ( -t X ) ]' bash
${THIS_SH} -c '[[ -n &' bash
${THIS_SH} -c '[[ -n XX &' bash
${THIS_SH} -c '[[ -n XX & ]' bash
${THIS_SH} -c '[[ 4 & ]]' bash
${THIS_SH} -c '[[ 4 > & ]]' bash
${THIS_SH} -c '[[ & ]]' bash
${THIS_SH} -c '[[ -Q 7 ]]' bash
${THIS_SH} -c '[[ -n < ]]' bash
# let's see what failed cond commands do with ERR trap
trap 'echo ERR: $LINENO: -$BASH_COMMAND- failed' ERR
[[ -n $unset ]]
func()
{
[[ -z nonempty ]]
}
func