From 0fec0f70a3f828893e737f7283f0ecc69752dbee Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 25 Sep 2019 16:48:35 +0300 Subject: [PATCH] pfetch: fix seq not posix --- pfetch | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pfetch b/pfetch index 06b9755..71d1908 100755 --- a/pfetch +++ b/pfetch @@ -932,10 +932,13 @@ main() { # art in height, don't touch the cursor, else move it down N lines. cursor_pos=$((info_height > ascii_height ? 0 : ascii_height - info_height)) - # Print '$cursor_pos' amount of newlines. Using cursor down doesn't scroll - # the screen correctly if this causes the cursor to hit the bottom of the - # window. Using '0' gives us an extra iteration, adding a bottom line gap. - printf '%0.s\n' $(seq 0 "$cursor_pos") >&6 + # Print '$cursor_pos' amount of newlines to correctly position the + # cursor. This used to be a 'printf $(seq X X)' however 'seq' is only + # typically available (by default) on GNU based systems! + while [ "${i:-0}" -le "$cursor_pos" ]; do + printf '\n' + : $((i+=1)) + done >&6 } main "$@"