From 4cf9387cb8dc58d6a1ddcdc1df3d69d741a07656 Mon Sep 17 00:00:00 2001 From: Micyp Date: Wed, 13 Jan 2021 19:17:58 +0100 Subject: [PATCH] replace shebang with vim modeline, improve syntax --- bashcols | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bashcols b/bashcols index afe7c46..10af23d 100755 --- a/bashcols +++ b/bashcols @@ -1,4 +1,4 @@ -#!/bin/bash +# vim: syntax=bash: eval "reset_esc=\"\\e[0m\"" @@ -9,9 +9,9 @@ function colout() { return fi - local color=$1 + local color="$1" shift - tput setaf $color + tput setaf "$color" "$@" tput sgr0 } @@ -37,7 +37,7 @@ function defcol() { function dispcollist() { local width=${1:-16} local idx=0 - for colid in `seq 1 256`; do + for colid in {1..256}; do colout $colid printf "%3s " $colid idx=$(($idx+1)) if [[ $(($idx % $width)) -eq 0 ]]; then