Tarrasch / zsh-functional

Higher order functions for zsh
136 stars 12 forks source link

Add function `forever` #9

Open Tarrasch opened 11 years ago

Tarrasch commented 11 years ago

For instance

$ forever `echo hi`
> hi
> hi
> hi
> hi
...
NightMachinery commented 6 years ago
loop () {
    while true
    do
        eval "${@:2}"
        sleep ${1:-1}
    done
}
Tarrasch commented 6 years ago

Please send a PR. Although we shouldn't do any sleeping I think.

NightMachinery commented 6 years ago

I think I added the sleeping to make the command stoppable ... I’ll send a PR when I get to laptop.

On Sat, Oct 20, 2018 at 9:47 PM Arash Rouhani notifications@github.com wrote:

Please send a PR. Although we shouldn't do any sleeping I think.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Tarrasch/zsh-functional/issues/9#issuecomment-431606005, or mute the thread https://github.com/notifications/unsubscribe-auth/Aii--kpNLNrIJH0fS-SGBnVrLGB8CUZQks5um2imgaJpZM4Aj7S1 .