Created
January 27, 2021 12:41
-
-
Save yuwash/fee262786ba3ed0a3a68d4418c3335ff to your computer and use it in GitHub Desktop.
Pulsate following a pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
pulsate_once () { | |
export delay="$1" | |
echo -n O | |
sleep "$delay" | |
} | |
pulsate_word () { | |
word="$1" | |
echo -n "$word" | while read -n1 character; do | |
pulsate_once "$character" | |
done | |
} | |
main () { | |
pattern="$1" | |
while true; do | |
pulsate_word "$pattern" | |
done | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment