Copy Link
Add to Bookmark
Report

NULL mag Issue 09 16 256 colors in bash

eZine's profile picture
Published in 
null magazine
 · 3 years ago

below is a small bash script on how to use 256 ansi coloring in scripts, perhaps even more. with the rgb function you can choose the color you like and then write any text in that color.

thanx to shinobi for his hint on this ;)

    #!/bin/bash 

function rgb(){
printf "\x1b[38;2;$1;$2;$3m"
}

rgb 10 200 200
printf "Hello world"

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT