[Eisfair_dev] Re3a Problem in ein Script fc3bcr Update-chk --- Zeilenumbruch

Marcus Roeckrath marcus.roeckrath at gmx.de
Fr Nov 30 18:21:00 CET 2018


Hallo Holger,

Holger Bruenjes wrote:

> Das ist auch noch ein anderes Beispiel
> 
>     /dein/script/der/pfad &
>     echo -n "    Update Checker is now looking for updates, this
> will take a while!"
>     while [ -n "$(ps --no-headers $!)" ]
>     do
>         for s in / - \\ \|
>         do
>             printf "\r[$s]"
>             sleep .1
>         done
>     done
>     printf "\r"

Warum haben wir sowas nicht in der eislib:

#!/bin/sh

waitanimation () {
    pid=$1
    type=$2
    freq=$3
    text=$4
    echo -n "${text}"
    while [ -n "$(ps --no-headers $pid)" ]
    do
        case "${type}"
        in
            windmill)
                for s in / - \\ \|
                do
                    printf "\r${text}[$s]"
                    sleep ${freq}
                done
            ;;
            points)
                echo -n "."
                sleep ${freq}
            ;;
        esac
    done
    echo
}

-- 
Gruss Marcus


Mehr Informationen über die Mailingliste Eisfair_dev