How to resolve the algorithm Terminal control/Inverse video step by step in the UNIX Shell programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Terminal control/Inverse video step by step in the UNIX Shell programming language

Table of Contents

Problem Statement

Display a word in inverse video   (or reverse video)   followed by a word in normal video.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Terminal control/Inverse video step by step in the UNIX Shell programming language

Source code in the unix programming language

#!/bin/sh
tput mr     # foo is reversed
echo 'foo'
tput me     # bar is normal video
echo 'bar'


$ TERM=dumb tput mr
tput: Unknown terminfo capability `mr'


tput so     # enter standout mode
echo 'foo'
tput se     # exit standout mode
echo 'bar'


tput mr
echo 'foo'
tput me
echo 'bar'


  

You may also check:How to resolve the algorithm FizzBuzz step by step in the Potion programming language
You may also check:How to resolve the algorithm Priority queue step by step in the Rust programming language
You may also check:How to resolve the algorithm Time a function step by step in the C++ programming language
You may also check:How to resolve the algorithm Web scraping step by step in the Microsoft Small Basic programming language
You may also check:How to resolve the algorithm Pinstripe/Display step by step in the Ada programming language