Sujet : Re: [ksh93u+m] alarm timer function
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.unix.shellDate : 18. Mar 2024, 20:39:51
Autres entêtes
Organisation : None to speak of
Message-ID : <874jd32ut4.fsf@nosuchdomain.example.com>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Janis Papanagnou <janis_papanagnou+
ng@hotmail.com> writes:
In ksh93u+ I'm using the built-in 'alarm' timer command.
>
$ alarm --man
Usage: alarm [-r] [varname seconds]
>
(The original 'alarm' feature may have been experimental
and not documented well, but it was nonetheless useful.)
>
Just noticed in ksh93u+m that the 'alarm' timer command
doesn't seem to be available; I now get errors like
"alarm: not found"
and
timer.alarm: invalid discipline function
>
Is there some substitute in ksh93u+m that will replace
that function from the original ksh? (Or something else
to do to get it working?) Or has that feature just been
abandoned in the "u+m" branch?
I know this isn't useful to you, but tcsh has a similar command called
"sched".
https://linux.die.net/man/1/tcshFor example, `sched 09:00 echo hello` will print "hello" at 9:00.
Scheduled commands run only while the shell is waiting at a prompt for
input. Missed commands are executed at the next prompt.
"""
This mechanism is similar to, but not the same as, the at(1) command on
some Unix systems. Its major disadvantage is that it may not run a
command at exactly the specified time. Its major advantage is that
because sched runs directly from the shell, it has access to shell
variables and other structures. This provides a mechanism for changing
one's working environment based on the time of day.
"""
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comWorking, but not speaking, for Medtronicvoid Void(void) { Void(); } /* The recursive call of the void */