emanuele6 1667004317 learn not only the ${par+word}, ${par=word}, and ${par-word} PEs evaluate the `word' part only if $par is set (or unset for ${par-}). The ${par#pattern}, ${par%}, ${par##}, ${par##}, ${par^}, ${par^^}, ${par,}, ${par,,}, and ${par/} PEs also only evaluate the `pattern' part only if $par is not empty, and the ${par:offset:length} PE also only evaluates the `offset' and `length' parts if $par emanuele6 1667004335 forget emanuele6 1667004620 learn PEs only evaluate their rhs arguments if necessary. e.g. "${var-$(date)}" will only evaluate date if var is unset; also, less intuitively, "${var#"${x=foo}"}" will only evalute ${x=foo} if $var is not empty, and ${var:i++:j++} will only evaluate i++ if $var is not empty, and will only evaluate j++ if the result of i++ is less than or equal to ${#var}. emanuele6 1667004635 forget emanuele6 1667004653 learn PEs only evaluate their rhs arguments if necessary. e.g. "${var-$(date)}" will only evaluate $(date) if var is unset; also, less intuitively, "${var#"${x=foo}"}" will only evalute ${x=foo} if $var is not empty, and ${var:i++:j++} will only evaluate i++ if $var is not empty, and will only evaluate j++ if the result of i++ is less than or equal to ${#var}. emanuele6 1667004979 forget emanuele6 1667005211 learn PEs only evaluate their rhs arguments if necessary. e.g. "${var-$(date)}" will only evaluate $(date) if $var is unset; also, less intuitively, "${var#"${x=foo}"}" will only evalute ${x=foo} if $var is set and not empty, and ${var:i++:j++} will only evaluate i++ if $var is set and not empty, and will only evaluate j++ if the result of i++ was greater than -${#var}, but less than ${#var}, emanuele6 1667005216 forget emanuele6 1667005434 learn PEs only evaluate their rhs arguments if necessary. e.g. "${var-$(date)}" will only evaluate $(date) if $var is unset; also, less intuitively, "${var#"${x=foo}"}" will only evalute ${x=foo} if $var is set and not empty, and ${var:i++:j++} see !weird${var:off:len} emanuele6 1667005620 forget emanuele6 1667005649 learn PEs only evaluate their rhs arguments if necessary. e.g. "${var-$(date)}" will only evaluate $(date) if $var is unset; also, less intuitively, "${var#"${x=foo}"}" will only evalute ${x=foo} if $var is set and not empty. The ${var:length:offset} is weird; see !lazy${var:off:len} for details emanuele6 1667006073 forget emanuele6 1667006100 learn PEs only evaluate their rhs arguments if necessary. e.g. "${var-$(date)}" will only evaluate $(date) if $var is unset; also, less intuitively, "${var#"${x=foo}"}" will only evalute ${x=foo} if $var is set and not empty. The ${var:offset:length} is weird; see !lazy${var:off:len} for details. emanuele6 1667024220 forget emanuele6 1667024238 learn PEs only evaluate their rhs arguments if necessary. e.g. "${var-$(date)}" will only evaluate $(date) if $var is unset; also, less intuitively, "${var#"${x=foo}"}" will only evalute ${x=foo} if $var is set and not empty. ${var:offset:length} will only evaluate `offset' if $var is set and not empty, and will only evaluate `length' if the result of `offset' is between -${#var} and ${#var}.