Re: script: bourne etc flite

Eli the Bearded <*@eli.users.panix.com> Wed, 13 Oct 2021 00:44:43 -0000 (UTC)
Newsgroups alt.ascii-art.animation
Organization Some absurd concept
Message-ID <[email protected]>
In alt.ascii-art.animation, Conor Williams  <[email protected]> wrote:
> #!/bin/sh
> #[email protected] bird /c:202109090808:23
> takeit() 
> {
> #       echo $0
> #       echo $*
> #       echo $1
> #       echo $2
> #       echo hello
> #       echo $1; sleep 1; clear
> 
>         for i in $*
>         do
>                 echo $i; sleep 1; clear
> 
>         done
> }
> 
> takeitdown ()
> {
>         for i in $*
>         do
>                 echo $i; sleep 1; clear
>         done
> }
> 
> while [ 1 ]; do
>         /bin/echo -e ^[c
>         takeit -----00----- ~~~~~00~~~~~ ~^~~~00~~~^~ ^^~~~00~~~^^
> ^^^==00==^^^ ^^^^-00-^^^^ ^^^^^00^^^^^
>         takeitdown \'@@@@00@@@@\' \'\'\'\'\'00\'\'\'\'\'
> done
> 

The ^[c isn't doing anything for me in an xterm, even after I fix it to
have an actual escape. This system's /bin/echo doesn't do -e, and ksh's
(and bash's) "echo -e" needs a \E for escape.

I don't see why you have takeit and takeitdown (is it a reference I'm
missing?) And lack of fractional sleep is why shell scripts are a hard
way to do animation. :^(

Anyway, borrowing your design:

#!/bin/sh
# catchin-flies.sh
takeit() {
  clear
  for i in "$@";  do
    echo "$i"
  done
  sleep 1
}

n=0
while [ "$n" != 5 ]; do
  n=$(($n + 1))
  takeit  "----->00" "     (__)"
  takeit  "*---->00" "     (__)"
  takeit  "  *-->00" "     (__)"
  takeit  "    *>00" "     (__)"
  takeit  "    *>00" "     (__)"
  takeit  "     =00" "     (__)"
  takeit  "     >oo  --__" "     {__}     -- ribbit"
  takeit  "     =00" "     (__)"
done
exit

Elijah
------
just a quicky