Welcome, guest | Sign In | My Account | Store | Cart

This is a simple loop that displays a rainbow of different colors.

Bash, 14 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#!/bin/bash -   
#title          :colorscale.sh
#description    :Show a rainbow of colors.
#author         :bgw
#date           :20111002
#version        :0.1    
#usage          :./colorscale.sh
#notes          :       
#bash_version   :4.1.5(1)-release
#==============================================================================

for c in {0..255} ; do
    echo -e "\e[38;05;${c}m ${c} Bash Prompt Color Chart" 
done

Use this to trick out you terminal prompt. I ran this on a Debian based system in gnome-terminal. I have not tested it on anything else. This does not work with GNU screen because it see colors differently.

Created by userend on Sun, 2 Oct 2011 (GPL3)
Bash recipes (41)
userend's recipes (6)

Required Modules

  • (none specified)

Other Information and Tasks