Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

White dwarf seeks red giant for binary relationship.


devel / comp.unix.shell / Re: [ksh93u+m] alarm timer function

SubjectAuthor
* [ksh93u+m] alarm timer functionJanis Papanagnou
+* Re: [ksh93u+m] alarm timer functionDavid W. Hodgins
|`* Re: [ksh93u+m] alarm timer functionJanis Papanagnou
| +* Re: [ksh93u+m] alarm timer functionDavid W. Hodgins
| |`- Re: [ksh93u+m] alarm timer functionJanis Papanagnou
| `* Re: [ksh93u+m] alarm timer functionKaz Kylheku
|  +- Re: [ksh93u+m] alarm timer functionRichard Harnden
|  `* Re: [ksh93u+m] alarm timer functionJanis Papanagnou
|   `* Re: [ksh93u+m] alarm timer functionArti F. Idiot
|    +* Re: [ksh93u+m] alarm timer functionJanis Papanagnou
|    |`- Re: [ksh93u+m] alarm timer functionArti F. Idiot
|    `- Re: [ksh93u+m] alarm timer functionJohn-Paul Stewart
`* Re: [ksh93u+m] alarm timer functionKeith Thompson
 `- Re: [ksh93u+m] alarm timer functionLawrence D'Oliveiro

1
[ksh93u+m] alarm timer function

<ut6vru$3iq7v$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6947&group=comp.unix.shell#6947

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: [ksh93u+m] alarm timer function
Date: Sun, 17 Mar 2024 15:48:21 +0100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <ut6vru$3iq7v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 17 Mar 2024 14:48:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2b631c83dd832849eea01af0705d2779";
logging-data="3762431"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/7bogUgqRm8kCfP2prrFq"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:OuAPi9IIYYTTw9LKbCSHqOmPxAk=
X-Mozilla-News-Host: news://news.eternal-september.org:119
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Sun, 17 Mar 2024 14:48 UTC

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?

Janis

Re: [ksh93u+m] alarm timer function

<op.2ksg5bhua3w0dxdave@hodgins.homeip.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6948&group=comp.unix.shell#6948

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dwhodg...@nomail.afraid.org (David W. Hodgins)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Sun, 17 Mar 2024 13:49:49 -0400
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <op.2ksg5bhua3w0dxdave@hodgins.homeip.net>
References: <ut6vru$3iq7v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="fd60d4a6e4db8776161ab1c3365f980e";
logging-data="3841807"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8ofN9k6og4JRDMof1NAt7ZyNSQ9qvlzY="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:XBtfV07fllI1imHnfN+ERIe2p9E=
 by: David W. Hodgins - Sun, 17 Mar 2024 17:49 UTC

On Sun, 17 Mar 2024 10:48:21 -0400, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:

> 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'm not a ksh user, so don't know much about it. I recommend using the package
"at" for setting alarms and it's not shell dependent.

Regards, Dave Hodgins

Re: [ksh93u+m] alarm timer function

<ut7bvh$3lhac$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6949&group=comp.unix.shell#6949

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Sun, 17 Mar 2024 19:15:11 +0100
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <ut7bvh$3lhac$1@dont-email.me>
References: <ut6vru$3iq7v$1@dont-email.me>
<op.2ksg5bhua3w0dxdave@hodgins.homeip.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 17 Mar 2024 18:15:13 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2b631c83dd832849eea01af0705d2779";
logging-data="3851596"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/cRoj0dmKKNN5/7j6CEioS"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:cuzznVCczHV3FDRJLnVabBEZYRc=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <op.2ksg5bhua3w0dxdave@hodgins.homeip.net>
 by: Janis Papanagnou - Sun, 17 Mar 2024 18:15 UTC

On 17.03.2024 18:49, David W. Hodgins wrote:
> On Sun, 17 Mar 2024 10:48:21 -0400, Janis Papanagnou
> <janis_papanagnou+ng@hotmail.com> wrote:
>
>> 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'm not a ksh user, so don't know much about it. I recommend using the
> package
> "at" for setting alarms and it's not shell dependent.

Thanks for the suggestion. It reminds me that I obviously
should have made the use case clear, where and how I want
to use the timer. For example; I want to display a turning
"wheel" (or maybe a growing bar) while some operation is
in progress. I might use such a timer in a program called
'busy'. And instead of calling

$ long_running_process arguments

I'd call it as

$ busy long_running_process arguments

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.

Janis

Re: [ksh93u+m] alarm timer function

<op.2ksi6xrra3w0dxdave@hodgins.homeip.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6950&group=comp.unix.shell#6950

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dwhodg...@nomail.afraid.org (David W. Hodgins)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Sun, 17 Mar 2024 14:33:59 -0400
Organization: A noiseless patient Spider
Lines: 64
Message-ID: <op.2ksi6xrra3w0dxdave@hodgins.homeip.net>
References: <ut6vru$3iq7v$1@dont-email.me>
<op.2ksg5bhua3w0dxdave@hodgins.homeip.net> <ut7bvh$3lhac$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="fd60d4a6e4db8776161ab1c3365f980e";
logging-data="3860145"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/9rRqJ3DIITuCVvIkRnQ9M4zq2x/FMR/A="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:Nemc55Hu5wpzAFEKZ/Je705pQC4=
 by: David W. Hodgins - Sun, 17 Mar 2024 18:33 UTC

On Sun, 17 Mar 2024 14:15:11 -0400, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:

> On 17.03.2024 18:49, David W. Hodgins wrote:
>> On Sun, 17 Mar 2024 10:48:21 -0400, Janis Papanagnou
>> <janis_papanagnou+ng@hotmail.com> wrote:
>>
>>> 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'm not a ksh user, so don't know much about it. I recommend using the
>> package
>> "at" for setting alarms and it's not shell dependent.
>
> Thanks for the suggestion. It reminds me that I obviously
> should have made the use case clear, where and how I want
> to use the timer. For example; I want to display a turning
> "wheel" (or maybe a growing bar) while some operation is
> in progress. I might use such a timer in a program called
> 'busy'. And instead of calling
>
> $ long_running_process arguments
>
> I'd call it as
>
> $ busy long_running_process arguments
>
> 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.

For that use case, I'd use a loop in a separate script with "sleep 0.5s". Have
the main script start it in the background, and kill it when the process is done.
The script containing the loop could create a pid file so the main script knows
what process to kill, or have the main script create a temp file, pass the name
to the loop script, and have the loop script exit after the main script deletes
the temp file.

Regards, Dave Hodgins

Re: [ksh93u+m] alarm timer function

<20240317130014.795@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6951&group=comp.unix.shell#6951

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Sun, 17 Mar 2024 20:01:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <20240317130014.795@kylheku.com>
References: <ut6vru$3iq7v$1@dont-email.me>
<op.2ksg5bhua3w0dxdave@hodgins.homeip.net> <ut7bvh$3lhac$1@dont-email.me>
Injection-Date: Sun, 17 Mar 2024 20:01:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="864941e21c918841c5381afe3a2ae04e";
logging-data="3896230"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SyHKdrI6DJ4sk6zwE3cNxAMbDQyDhLls="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:RlLxJxHLxMN80IZncl9gQ0630+A=
 by: Kaz Kylheku - Sun, 17 Mar 2024 20:01 UTC

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/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: [ksh93u+m] alarm timer function

<ut7jji$3n956$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6952&group=comp.unix.shell#6952

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: richard....@gmail.invalid (Richard Harnden)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Sun, 17 Mar 2024 20:25:22 +0000
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <ut7jji$3n956$1@dont-email.me>
References: <ut6vru$3iq7v$1@dont-email.me>
<op.2ksg5bhua3w0dxdave@hodgins.homeip.net> <ut7bvh$3lhac$1@dont-email.me>
<20240317130014.795@kylheku.com>
Reply-To: nospam.harnden@invalid.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 17 Mar 2024 20:25:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8b5db93112e89f001cde417a18766f24";
logging-data="3908774"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/Lc2Z/KfEMwvnKEnqklOUkNbxGyZyAFQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:uwDm4tj9STutYXRJNSqR7HzcLb4=
In-Reply-To: <20240317130014.795@kylheku.com>
Content-Language: en-GB
 by: Richard Harnden - Sun, 17 Mar 2024 20:25 UTC

On 17/03/2024 20:01, Kaz Kylheku wrote:
> 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.
>

kill -0 <pid> asks ksh whether that process is still running (rather
than actually sending a signal), so something like ... ?

function busy
{ BUSY_PROG=$1
shift

${BUSY_PROG} $@ &

BUSY_PID=$!

while :
do
kill -0 ${BUSY_PID} 2>/dev/null || break
echo -n .
sleep 1
done

wait %1
return $?
}

Re: [ksh93u+m] alarm timer function

<ut8kjf$19q6$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6953&group=comp.unix.shell#6953

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Mon, 18 Mar 2024 06:48:29 +0100
Organization: A noiseless patient Spider
Lines: 75
Message-ID: <ut8kjf$19q6$1@dont-email.me>
References: <ut6vru$3iq7v$1@dont-email.me>
<op.2ksg5bhua3w0dxdave@hodgins.homeip.net> <ut7bvh$3lhac$1@dont-email.me>
<op.2ksi6xrra3w0dxdave@hodgins.homeip.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 18 Mar 2024 05:48:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="beed24fa55e309b84ff2aacf6e5279a8";
logging-data="42822"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+S4Uf2G7Z/khmn/G8E6JXc"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:HjxBOiX26KWVQIWZvGUccMjlcTc=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <op.2ksi6xrra3w0dxdave@hodgins.homeip.net>
 by: Janis Papanagnou - Mon, 18 Mar 2024 05:48 UTC

On 17.03.2024 19:33, David W. Hodgins wrote:
> On Sun, 17 Mar 2024 14:15:11 -0400, Janis Papanagnou
> <janis_papanagnou+ng@hotmail.com> wrote:
>
>> On 17.03.2024 18:49, David W. Hodgins wrote:
>>> On Sun, 17 Mar 2024 10:48:21 -0400, Janis Papanagnou
>>> <janis_papanagnou+ng@hotmail.com> wrote:
>>>
>>>> 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'm not a ksh user, so don't know much about it. I recommend using the
>>> package
>>> "at" for setting alarms and it's not shell dependent.
>>
>> Thanks for the suggestion. It reminds me that I obviously
>> should have made the use case clear, where and how I want
>> to use the timer. For example; I want to display a turning
>> "wheel" (or maybe a growing bar) while some operation is
>> in progress. I might use such a timer in a program called
>> 'busy'. And instead of calling
>>
>> $ long_running_process arguments
>>
>> I'd call it as
>>
>> $ busy long_running_process arguments
>>
>> 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.
>
> For that use case, I'd use a loop in a separate script with "sleep
> 0.5s". Have the main script start it in the background, and kill it
> when the process is done. The script containing the loop could create
> a pid file so the main script knows what process to kill, or have the
> main script create a temp file, pass the name to the loop script, and
> have the loop script exit after the main script deletes the temp
> file.

Yes, I am aware of several methods (like the one you describe or other)
how to tackle the task. I prefer a simple and built-in method, though.

I admit that I am spoiled on that since I had that feature available
in the past, and losing an option and substitute it by other (complex)
ways is something not appearing appealing. :-/

Janis

Re: [ksh93u+m] alarm timer function

<ut8kpd$1bcl$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6954&group=comp.unix.shell#6954

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Mon, 18 Mar 2024 06:51:40 +0100
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <ut8kpd$1bcl$1@dont-email.me>
References: <ut6vru$3iq7v$1@dont-email.me>
<op.2ksg5bhua3w0dxdave@hodgins.homeip.net> <ut7bvh$3lhac$1@dont-email.me>
<20240317130014.795@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 18 Mar 2024 05:51:41 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="beed24fa55e309b84ff2aacf6e5279a8";
logging-data="44437"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KOcOYyVJ7jGBTSFyBpNkc"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:5t9refpycHkwFFXhaX7eMGobhi4=
In-Reply-To: <20240317130014.795@kylheku.com>
 by: Janis Papanagnou - Mon, 18 Mar 2024 05:51 UTC

On 17.03.2024 21:01, Kaz Kylheku wrote:
> 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.

Yes, I remember. There's a couple options to solve such a task. In case
I have a simple built-in method available I'd prefer that, though.

Janis

Re: [ksh93u+m] alarm timer function

<ut9i86$1q6o$1@nnrp.usenet.blueworldhosting.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6955&group=comp.unix.shell#6955

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED!not-for-mail
From: add...@is.invalid (Arti F. Idiot)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Mon, 18 Mar 2024 08:14:30 -0600
Organization: Anarchists of America
Message-ID: <ut9i86$1q6o$1@nnrp.usenet.blueworldhosting.com>
References: <ut6vru$3iq7v$1@dont-email.me>
<op.2ksg5bhua3w0dxdave@hodgins.homeip.net> <ut7bvh$3lhac$1@dont-email.me>
<20240317130014.795@kylheku.com> <ut8kpd$1bcl$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 18 Mar 2024 14:14:30 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com;
logging-data="59608"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:FViAScQ4mQtR3QwF2siG9dKMy9Y= sha256:dCxmSLsCyx8kypzkbT16+jFUynxwuhuLmn8JTDqf5kw=
sha1:jE0TQf73axiV9f1TkWQP/7Wa3nE= sha256:5so85/t83ARVuJhH/wI2pAnbdWnY3+kcI5j+i6TgPBQ=
In-Reply-To: <ut8kpd$1bcl$1@dont-email.me>
Content-Language: en-US
 by: Arti F. Idiot - Mon, 18 Mar 2024 14:14 UTC

On 3/17/24 11:51 PM, Janis Papanagnou wrote:
> On 17.03.2024 21:01, Kaz Kylheku wrote:
>> 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.
>
> Yes, I remember. There's a couple options to solve such a task. In case
> I have a simple built-in method available I'd prefer that, though.
>
> Janis
>

I think several OSes have a tool called 'progress' which sort of
functions as you've described; NetBSD does natively. Having it built-in
would be better though. Was 'alarm' removed in ksh93? I don't see it
on the NetBSD pkgsrc version.

Re: [ksh93u+m] alarm timer function

<ut9l8s$7r14$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6956&group=comp.unix.shell#6956

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Mon, 18 Mar 2024 16:06:02 +0100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <ut9l8s$7r14$1@dont-email.me>
References: <ut6vru$3iq7v$1@dont-email.me>
<op.2ksg5bhua3w0dxdave@hodgins.homeip.net> <ut7bvh$3lhac$1@dont-email.me>
<20240317130014.795@kylheku.com> <ut8kpd$1bcl$1@dont-email.me>
<ut9i86$1q6o$1@nnrp.usenet.blueworldhosting.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 18 Mar 2024 15:06:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="12f344fa15465a6d37e0823615045e9a";
logging-data="257060"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zDm/4EHddaxXXwtFbBC/L"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:OnTKjAWleaslOrKTQ0z9zbHGUrU=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <ut9i86$1q6o$1@nnrp.usenet.blueworldhosting.com>
 by: Janis Papanagnou - Mon, 18 Mar 2024 15:06 UTC

On 18.03.2024 15:14, Arti F. Idiot wrote:
>
> I think several OSes have a tool called 'progress' which sort of
> functions as you've described; NetBSD does natively.

Oh, I wasn't aware that there's some OS specific standard for that.

> Having it built-in would be better though. Was 'alarm' removed in
> ksh93?

It was (still is) there in [official] ksh93u+. That was the version
I predominantly used on my platforms.

Meanwhile I've replaced the "u+" version by Martijn Dekker's "u+m"
version. (The latter has less bugs and works much more reliable.)
It's just my recent switch that made me notice that in his branch
there's no 'alarm' available any more.

Janis

Re: [ksh93u+m] alarm timer function

<ut9shm$o4a$1@nnrp.usenet.blueworldhosting.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6957&group=comp.unix.shell#6957

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!news.quux.org!tncsrv06.tnetconsulting.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED!not-for-mail
From: add...@is.invalid (Arti F. Idiot)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Mon, 18 Mar 2024 11:10:14 -0600
Organization: Anarchists of America
Message-ID: <ut9shm$o4a$1@nnrp.usenet.blueworldhosting.com>
References: <ut6vru$3iq7v$1@dont-email.me>
<op.2ksg5bhua3w0dxdave@hodgins.homeip.net> <ut7bvh$3lhac$1@dont-email.me>
<20240317130014.795@kylheku.com> <ut8kpd$1bcl$1@dont-email.me>
<ut9i86$1q6o$1@nnrp.usenet.blueworldhosting.com>
<ut9l8s$7r14$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 18 Mar 2024 17:10:14 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com;
logging-data="24714"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:kqoME/a4juKX6Ky34BEMwrbQBKI= sha256:qUMNPrYY1JUmottqVod34ud0eYSNVz4wOpqqJ4pPI0E=
sha1:hgMRybFSoDUdfmeCCpyNL/Thy1g= sha256:mpKeP3sSzgdtqNRCeCPFU5hg2vseDMqzVH4d9Cdm3m4=
Content-Language: en-US
In-Reply-To: <ut9l8s$7r14$1@dont-email.me>
 by: Arti F. Idiot - Mon, 18 Mar 2024 17:10 UTC

On 3/18/24 9:06 AM, Janis Papanagnou wrote:
> On 18.03.2024 15:14, Arti F. Idiot wrote:
>>
>> I think several OSes have a tool called 'progress' which sort of
>> functions as you've described; NetBSD does natively.
>
> Oh, I wasn't aware that there's some OS specific standard for that.
>
>> Having it built-in would be better though. Was 'alarm' removed in
>> ksh93?
>
> It was (still is) there in [official] ksh93u+. That was the version
> I predominantly used on my platforms.
>
> Meanwhile I've replaced the "u+" version by Martijn Dekker's "u+m"
> version. (The latter has less bugs and works much more reliable.)
> It's just my recent switch that made me notice that in his branch
> there's no 'alarm' available any more.
>
> Janis
>

I was mistaken; alarm is in the att-ksh93 pkgsrc package, it's just an
undocumented built-in, apparently because D. Korn felt it it didn't
function consistently. My brief experiments earlier resulted in several
hung sessions. It's an interesting idea though.

Re: [ksh93u+m] alarm timer function

<874jd32ut4.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6958&group=comp.unix.shell#6958

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Mon, 18 Mar 2024 12:39:51 -0700
Organization: None to speak of
Lines: 42
Message-ID: <874jd32ut4.fsf@nosuchdomain.example.com>
References: <ut6vru$3iq7v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="f97e1c3debdb8027626a4403eeee570f";
logging-data="367942"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NAjGJl7/U+7BXZYv6OFvQ"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:RmamNvmcCiy4BtP3w2X49UTiA7M=
sha1:pkEw7M4ZVfM4snTmj+yzIh1WaBg=
 by: Keith Thompson - Mon, 18 Mar 2024 19:39 UTC

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/tcsh

For 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.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: [ksh93u+m] alarm timer function

<l5rmd2Fl85kU1@mid.individual.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6959&group=comp.unix.shell#6959

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: jpstew...@personalprojects.net (John-Paul Stewart)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Mon, 18 Mar 2024 16:27:14 -0400
Lines: 11
Message-ID: <l5rmd2Fl85kU1@mid.individual.net>
References: <ut6vru$3iq7v$1@dont-email.me>
<op.2ksg5bhua3w0dxdave@hodgins.homeip.net> <ut7bvh$3lhac$1@dont-email.me>
<20240317130014.795@kylheku.com> <ut8kpd$1bcl$1@dont-email.me>
<ut9i86$1q6o$1@nnrp.usenet.blueworldhosting.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net SXPAST6p+VLYL9mu65EIAw9PkcI92x+ulYKp21Yv7WfjICVfjn
Cancel-Lock: sha1:z/pft7MCowHFeQgMHwbkpX1ti/0= sha256:ujsjVB06g62s9yhFcZOpCqE5fJ+XvP5Qe9GnYpK7ZLM=
User-Agent: Mozilla Thunderbird
Content-Language: en-CA
In-Reply-To: <ut9i86$1q6o$1@nnrp.usenet.blueworldhosting.com>
 by: John-Paul Stewart - Mon, 18 Mar 2024 20:27 UTC

On 2024-03-18 10:14 a.m., Arti F. Idiot wrote:
>
> I think several OSes have a tool called 'progress' which sort of
> functions as you've described; NetBSD does natively. 

Careful, though. On Linux systems it is unlikely to be installed by
default. And even if it is installed, it's likely to be a very
different 'progress' program than the NetBSD one:

https://github.com/Xfennec/progress

Re: [ksh93u+m] alarm timer function

<utqvo1$ssb1$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6972&group=comp.unix.shell#6972

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell
Subject: Re: [ksh93u+m] alarm timer function
Date: Mon, 25 Mar 2024 04:49:06 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <utqvo1$ssb1$1@dont-email.me>
References: <ut6vru$3iq7v$1@dont-email.me>
<874jd32ut4.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 25 Mar 2024 05:49:06 +0100
Injection-Info: dont-email.me; posting-host="d4feffa95bbe0e58068bbc1004bce242";
logging-data="946529"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18iEGmTWz8Dj00vcUuuJAB9"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:ofVvS9clDG8ohHiIq8vsC4OISbo=
 by: Lawrence D'Oliv - Mon, 25 Mar 2024 04:49 UTC

On Mon, 18 Mar 2024 12:39:51 -0700, Keith Thompson wrote:

> Scheduled commands run only while the shell is waiting at a prompt for
> input.

I wonder why shells don’t make use of poll(2) to run things asynchronously
to command input.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor