From 37fab88237eab18b977a57c77c9ab2be87581cb6 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Fri, 12 Jul 2024 06:36:05 -0700 Subject: [PATCH] shave another 5 chars from `colors` --- sh/colors | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sh/colors b/sh/colors index f2d2a7a..28b44a6 100755 --- a/sh/colors +++ b/sh/colors @@ -4,11 +4,11 @@ colors() { ### @- ### display all combinations of foreground and background terminal colors. ### this only includes the basic 16-color palette. - ### excluding boilerplate, this script is a mere 72 characters long! + ### excluding boilerplate, this script is a mere 67 characters long! ### ### ![terminal colors](https://eaguru.guru/t/terminal-colors-2024.png) [ $# -eq 0 ] || { printf >&2 '%s: does not take arguments\n' colors; return 64 ;} - printf "\e[%dm`printf %s ' \e['{4,10}{0..7}'m mV \e[40m'`\n" {3,9}{0..7} + printf "\e[%dm `echo '\e['{4,10}{0..7}'m mV \e[40m'`\n" {3,9}{0..7} } [ -n "${preload+-}" ] || colors "$@"