From 76435a29bcae2171b849c92da5d7661634956223 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Sat, 26 Dec 2020 02:19:14 +0100 Subject: [PATCH] bash: factor out colortest into separate script --- roles/dotfiles/files/bashrc | 12 ------------ roles/dotfiles/files/bin/colortest | 11 +++++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) create mode 100755 roles/dotfiles/files/bin/colortest diff --git a/roles/dotfiles/files/bashrc b/roles/dotfiles/files/bashrc index 6d32015..78c5d64 100644 --- a/roles/dotfiles/files/bashrc +++ b/roles/dotfiles/files/bashrc @@ -402,18 +402,6 @@ styletest() { printf "$(tput invis)This text has the invisible attribute.${Reset}\n" } -# Print all 256 colors -colortest() { - local i j - for i in $(seq 0 15); do - for j in $(seq 0 15); do - local n=$(( 16 * i + j )) - printf "$(tput setab $n) %3d " $n - done - echo "$Reset" - done -} - ############################################################################## # Run external customizations ############################################################################## diff --git a/roles/dotfiles/files/bin/colortest b/roles/dotfiles/files/bin/colortest new file mode 100755 index 0000000..2ff8695 --- /dev/null +++ b/roles/dotfiles/files/bin/colortest @@ -0,0 +1,11 @@ +#!/bin/sh +# Print all 256 colors + +for i in $(seq 0 15); do + for j in $(seq 0 15); do + n=$(( 16 * i + j )) + printf '%s %3d ' "$(tput setab $n)" "$n" + done + printf '%s\n' "$(tput sgr0)" +done +