#!/bin/bash legs_out=( " " " .'''. " " - - " " | C ^ " " \ 7 " " | | " " / \\ " " | \\ \\ " " | \\ \\ " " / | \\ \\ " " / | \\ \\ " " / | \\ \\ " " / | |\\ \\ " " \\ \\ " " \\ " " / \\ " " / \\ " " / / \\ \\ " " / / \\ \\ " " / / \\ \\ " " / \ \\ \\ " " \\ \\ \\ \\... " " ____] [ ]" ) legs_cross=( " .'''. " " - - " " | C ^ " " \ 7 " " | | " " / \\ " " | | | " " | | | " " | | | " " | | | " " | | | " " ( | | | " " | | ) " " | | | " " | | | " " | | | " " | | ) " " | | | " " | | | " " | | | " " / | " " / | | " " \\..] / / " ) print_man() { local spaces=$1 local man=("${!2}") for line in "${man[@]}"; do printf "%*s%s\n" $spaces "" "$line" done } spaces=0 state=0 while true; do clear if (( state % 4 < 2 )); then print_man $spaces legs_out[@] else print_man $spaces legs_cross[@] fi ((spaces++)) ((state++)) if (( spaces > $(tput cols) )); then spaces=0 fi sleep 0.1 done