On Mon, 11 Dec 2023, Eli Schwartz wrote:
+ local color=yes
+ [[ ${NO_COLOR} ]] && color=no
[[ -v NO_COLOR ]]
No, this would give the wrong result if NO_COLOR is set to an empty
value. [[ ${NO_COLOR} ]] or [[ -n ${NO_COLOR} ]] is the correct test:
"Command-line software which adds ANSI color to its output by default
should check for a NO_COLOR environment variable that, when present
and not an empty string (regardless of its value), prevents the
addition of ANSI color." --
https://no-color.org/
-----BEGIN PGP SIGNATURE-----
iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmV3Yz0PHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uClYIAL+5wUHECMVKKOiIpQr5gEDBHroGeBk/0mU7 fzljO87HziNa4WGLW11ZzlGkovoB6x+uqLmjWzNQBxgBpP3p/qLbrsPSivoU+G1h H42WOCdGs8qAx1e1fORM3pzVVlLvgST01e3qHFFjtj4I9q2dHCtlTCNUWfrFUtjH 0IQg4Zb4y2ZbOdniJ9AlzxLZlalUvZtauBvUxvnjnHkOE7XwX0U6fbEzarbDhT3b e8TshIkU1KIeYAG7+SEMULcp860C2CBwRu+3Gni0E/FMXKxe+HDOn/kiquECAons Ctqwq4FWJJ+IX0g2AQTk6qkbDu9fFGckeXkyU+5iSSS+mN2QB7w=
=tVW2
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)