Re: Kommandozeilenmagie gesucht: tr, sed o.ä. für "Inverted Text"
Stefan Baur <newsgroups.mail2@stefanbaur.de> wrote:
> Ich sehe zwar jetzt, worauf Du hinaus wolltest, aber die Lösung von
> Christian Knoke (Message-ID: <[🔎] 20140905094531.GA2401@leo.home.cknoke.de>)
> finde ich da trotzdem eleganter, weil sie ohne Abhängigkeiten zu
> zusätzlichen Programmen auskommt.
Diese escape-codes sind allerdings, wie Christian selbst auch schrieb,
terminalspezifisch. Ich finde es generell sinnvoll, möglichst portabel
zu bleiben, das macht tput in diesem Fall.
Siehe auch console_codes(4):
It is generally not good practice to hard-wire terminal controls
into programs. Linux supports a terminfo(5) data- base of terminal
capabilities. Rather than emitting console escape sequences by
hand, you will almost always want to use a terminfo-aware screen
library or utility such as ncurses(3), tput(1), or reset(1).
Gruß, Martin
Reply to: