From 6cbf35151b8eef0607644ebbe33bc1dfb6327787 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 19 Jul 2021 18:32:30 +0300 Subject: [PATCH] kiss: remove second last sed call --- kiss | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kiss b/kiss index 6f6d8f4..62d8a4c 100755 --- a/kiss +++ b/kiss @@ -1804,11 +1804,19 @@ args() { esac done + IFS=\#$IFS + # Print each extension, grab its description from the second line # in the file and align the output based on the above max. for path do - printf "%b->%b %-${max}s " "$c1" "$c3" "${path#*/kiss-}" - sed -n 's/^# *//;2p' "$path" + # Open the extension as a file descriptor. + exec 3< "$path" + + # Grab the second line in the extension. + { read -r _ && read -r _ cmt; } <&3 + + printf "%b->%b %-${max}s %s\\n" \ + "$c1" "$c3" "${path#*/kiss-}" "$cmt" done >&2 ;;