Sujet : Re: [ksh93u+m] alarm timer function
De : 433-929-6894 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.unix.shellDate : 17. Mar 2024, 21:01:42
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240317130014.795@kylheku.com>
References : 1 2 3
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-03-17, Janis Papanagnou <janis_papanagnou+
ng@hotmail.com> wrote:
The program 'busy' could be something like
>
$ cat ~/bin/busy
typeset busy='/-\|'
typeset -i i=0
alarm -r timer +0.25
function timer.alarm { print -u2 -f "%c\b" -- "${busy:i++%4:1}" ;}
( "$@" & wait )
unset timer
>
with 'alarm' and 'timer.alarm' used as supported by ksh93u+.
>
I suppose the 'at' command is not suited for such purposes.
Remember how I rigged something up in the Basta project to spontaneously
update the clock in the status line, while the shell is waiting for
input or running scripts?
Forked process periodically killing parent with signal, which has a trap
handler for it.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca