Debugging an error of setterm, I realized that setterm --powerdown operates
on stdout but setterm --powersave operates on stdin. Such unexpected
behavior should be documented.
I prefer a less accurate generic "always redirect both stdin and stdout"
over recommending of the correct I/O stream for each option separately.
Signed-off-by: Stanislav Brabec <sbrabec@xxxxxxx>
---
term-utils/setterm.1.adoc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/term-utils/setterm.1.adoc b/term-utils/setterm.1.adoc
index 880fe10d6..365c4bb00 100644
--- a/term-utils/setterm.1.adoc
+++ b/term-utils/setterm.1.adoc
@@ -156,6 +156,10 @@ Turns underline mode on or off.
include::man-common/help-version.adoc[]
+== WARNING
+
+Use of *setterm* in combination with stdout redirection can have
unexpected results, as some options operate on stdin. To prevent
problems, always redirect both stdin and stdout to the same device.
+
== COMPATIBILITY
Since version 2.25 *setterm* has support for long options with two
hyphens, for example *--help*, beside the historical long options with a
single hyphen, for example *-help*. In scripts it is better to use the
backward-compatible single hyphen rather than the double hyphen.
Currently there are no plans nor good reasons to discontinue
single-hyphen compatibility.
--
2.43.0
--
Best Regards / S pozdravem,
Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o. e-mail: sbrabec@xxxxxxxx
Křižíkova 148/34 (Corso IIa) tel: +420 284 084 060
186 00 Praha 8-Karlín fax: +420 284 084 001
Czech Republic http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76