aboutsummaryrefslogtreecommitdiffstats
path: root/gotrc-examples/lower-left-ponysay
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-09-30 23:29:44 +0200
committerMattias Andrée <maandree@operamail.com>2013-09-30 23:29:44 +0200
commit89f8903bc5b942211c95e3a1dfdf1d030be8596d (patch)
tree169e8232171e24e6a317e83701f59081a8eb72da /gotrc-examples/lower-left-ponysay
parentderp (diff)
downloadgates-of-tartaros-89f8903bc5b942211c95e3a1dfdf1d030be8596d.tar.gz
gates-of-tartaros-89f8903bc5b942211c95e3a1dfdf1d030be8596d.tar.bz2
gates-of-tartaros-89f8903bc5b942211c95e3a1dfdf1d030be8596d.tar.xz
portability
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'gotrc-examples/lower-left-ponysay')
-rw-r--r--gotrc-examples/lower-left-ponysay9
1 files changed, 5 insertions, 4 deletions
diff --git a/gotrc-examples/lower-left-ponysay b/gotrc-examples/lower-left-ponysay
index 563790d..686535a 100644
--- a/gotrc-examples/lower-left-ponysay
+++ b/gotrc-examples/lower-left-ponysay
@@ -7,14 +7,15 @@
function _display
{
- PALETTE=$'\e]P0020840\e]P1CD656C\e]P232A679\e]P3CCAD47\e]P42495BE\e]P5A46EB0\e]P600A09F\e]P7D3D7CF\e]P8555753\e]P9EB5E6A\e]PA0EC287\e]PBF2CA38\e]PC00ACE0\e]PDC473D1\e]PE00C3C7\e]PFEEEEEE'
+ PALETTE=$(echo -e '\e]P0020840\e]P1CD656C\e]P232A679\e]P3CCAD47\e]P42495BE\e]P5A46EB0\e]P600A09F\e]P7D3D7CF\e]P8555753\e]P9EB5E6A\e]PA0EC287\e]PBF2CA38\e]PC00ACE0\e]PDC473D1\e]PE00C3C7\e]PFEEEEEE')
echo -n "${PALETTE}"
echo -en '\e[H\e[2J\e[?8c'
pony="$(PONYSAY_SHELL_LINES=5 PONYSAY_KMS_PALETTE="${PALETTE}" ponysay -o <&2)"
- lines=$(wc -l <<< "${pony}")
+ lines=$(echo "${pony}" | wc -l)
height=$(stty size | cut -d ' ' -f 1)
- echo -n $'\e['"$(( $height - $lines + 1 ));1H$(sed -e 's:\x1b\[H\x1b\[2J::' <<< "${pony}")${PALETTE}"$'\e[H'
- echo -e "\e[${ANSI_COLOR}m${NAME} (${tty})\e[00m"
+ echo -en $'\e['"$(( $height - $lines + 1 ));1H"
+ echo -n "$(echo "${pony}" | sed -e 's:\x1b\[H\x1b\[2J::')${PALETTE}"
+ echo -e "\e[H\e[${ANSI_COLOR}m${NAME} (${tty})\e[00m"
echo
echo -n 'Login: '
}