On 12/18/24 9:39 PM, Zachary Santer wrote:
If one wants to use funsubs that don't expand to anything as a workaround like this, it might be more efficient to use the ${| command; } form, as bash then isn't pointlessly redirecting stdout.The manual describes 'set -u'/'set -o nounset' thusly: Treat unset variables and parameters other than the special parameters “@” and “*”, or array variables subscripted with “@” or “*”, as an error when performing parameter expansion. If expansion is attempted on an unset variable or parameter, the shell prints an error message, and, if not interactive, exits with a non-zero status.
So you're saying that bash looking at a specific variable and using its value should fail if that variable is unset? How far do you want to take that? PS2? PS4? GLOBIGNORE? COMPREPLY? -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature