Bug#928920: patch: Introduce logging functions that check ${VERBOSE}
Thorsten Glaser <[email protected]> Tue, 13 Aug 2019 20:27:36 +0000 (UTC)
| Newsgroups | gmane.linux.debian.devel.lsb |
|---|---|
| Message-ID | <Pine.BSM.4.64L.1908132025480.321__15702.0676577062$1565728582$gmane$org@herc.mirbsd.org> |
Dmitry Bogatov dixit:
>--- /dev/null
>+++ b/init-functions.d/00-verbose.jinja
>@@ -0,0 +1,9 @@
>+## Generated automatically. Do not edit! -*- shell-script -*-
>+{% for fn in log_functions %}
>+v{{ fn }} () {
=E2=86=91 no space here, please, for pdksh compatibility
=09=09(allowing the space is a bashism)
>+=09if test "${VERBOSE:-yes}" !=3D no ; then
instead:if test x"${VERBOSE:-yes}" !=3D x"no"; then
>+=09=09{{ fn }} "$@"
>+=09fi
>+}
>+{% endfor %}
Reason: test(1) can behave funny if the argument starts with
a hyphen-minus so when using test or [ instead of the secure
[[ of Korn shell use the x"=E2=80=A6" =3D x"=E2=80=A6" form.
bye,
//mirabilos
--=20
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh