Exit Status
The tput
command provides exit status to indicate the success or failure of its execution. Here are the exit status codes commonly used:
0
: Indicates successful execution without any errors.1
: Indicates a general error or failure during execution.2
: Indicates invalid or unsupported capability or argument provided totput
.
How to Change the Output Color of Echo in Linux
When working with a computer, some users may encounter a situation where they need to output text in a different color. The colors we are familiar with by now will have been worked out for our particular machine and thus can be replaced easily if needed. Echo is a Linux command that can be used to change the output color of the text. Any text entered using echo is displayed in the new color before being output. The input method for this feature varies: bash, zsh, and python (as well as other shell extensions) will provide option -E, which disables it. There are several ways to change foreground and background colors in Linux. Some examples showing how to use echo are included on this page.