From 47eba4945758653ffa71464bb566b9e921a859f8 Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 29 Mar 2016 18:17:30 +1100 Subject: [PATCH] Swap to a portable way of getting the ascii size' --- neofetch | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/neofetch b/neofetch index e1bec84a..4ebf52be 100755 --- a/neofetch +++ b/neofetch @@ -1857,14 +1857,10 @@ getascii () { ascii_strip=${ascii_strip//\\} # Get length of longest line - ascii_size=($(wc -lL 2>/dev/null <<< "$ascii_strip")) + ascii_size=($(awk 'END {print NR}length>max{max=length}END{print max}' <<< "$ascii_strip")) ascii_height=${ascii_size[0]} ascii_length=${ascii_size[1]} - # Fallback to using awk on systems without 'wc -L' - [ -z "$ascii_length" ] && \ - ascii_length="$(awk 'length>max{max=length}END{print max}' <<< "$ascii_strip")" - padding="\033[$((ascii_length + gap))C" printf "%b%s" "$print"