TheGrandParadise.com New What is tput in Linux?

What is tput in Linux?

What is tput in Linux?

The tput command allows shell scripts to do things like clear the screen, underline text, and center text no matter how wide the screen is. To do these things, it translates the terminal-independent name of a terminal capability into its actual value for the terminal type being used.

What is tput command?

Description. The tput command uses the terminfo database to make terminal-dependent information available to the shell. The tput command outputs a string if the attribute CapabilityName is of type string. The output string is an integer if the attribute is of type integer.

How do you use tput?

On Unix-like operating systems, the tput command initializes a terminal or queries the terminfo database….Description.

string tput writes the string to the standard output. No trailing newline is supplied.
integer tput writes the decimal value to the standard output, with a trailing newline.

What is tput Smso?

bold=’tput smso’ offbold=’tput rmso’ Set the shell variables bold, to begin stand-out mode sequence, and offbold, to end standout mode sequence, for the current terminal. This might be followed by a prompt: echo “${bold}Please type in your name: ${offbold}\c”

Is tput portable?

If you use tput (or the underlying tputs(3) ), your program is hence automatically portable to different terminals.

What does tput Reset do?

DESCRIPTION. The tput utility uses the terminfo database to make the values of terminal-dependent capabilities and information available to the shell (see sh(1)), to initialize or reset the terminal, or return the long name of the requested terminal type.

What is tput setaf?

“tput setaf” sets foreground color, “tput setab” sets background color, and “tput sgr0” resets all the settings to terminal default. There are 8 standard colors encoded in numbers from 0 to 7 (in order: black, red, green, yellow, blue, magenta, cyan, white).

Which option is used with tput command to set background color?

tput setab
Fortunately, there’s another option: the tput command. It enables us to query the terminfo database and provides a convenient way to extract escape codes we need. “tput setaf” sets foreground color, “tput setab” sets background color, and “tput sgr0” resets all the settings to terminal default.

What is tput in Linux terminal?

The tput utility uses the terminfo database to make the values of terminal-dependent capabilities and information available to the shell (see sh (1)), to initialize or reset the terminal, or return the long name of the requested terminal type. The result depends upon the capability’s type: tput writes the string to the standard output.

What is tput-ttype?

tput [ -Ttype] capname [ parms ] The tput utility uses the terminfo database to make the values of terminal-dependent capabilities and information available to the shell (see sh (1)), to initialize or reset the terminal, or return the long name of the requested terminal type. The result depends upon the capability’s type:

What is the result of tput?

The result depends upon the capability’s type: tput writes the string to the standard output. No trailing newline is supplied. tput writes the decimal value to the standard output, with a trailing newline. tput sets the exit code ( 0 for TRUE if the terminal has the capability, 1 for FALSE if it does not), and writes nothing to the standard output.

Does tput support termcap names?

Other implementations of tput on SVr4-based systems such as Solaris, IRIX64 and HPUX as well as others such as AIX and Tru64 provide support for capname operands. A few platforms such as FreeBSD and NetBSD recognize termcap names rather than terminfo capability names in their respective tput commands.