Re: [dev] New utility "when"

From: Dimitris Zervas <dzervas_AT_dzervas.gr>
Date: Wed, 11 Dec 2013 20:25:32 +0200

Suckless does not have tools that don't exist or can't be created with
bash. It has some bash scripts implemented in C, something
disgustingly performance efficient.

On Wed, Dec 11, 2013 at 8:21 PM, Andrew Gwozdziewycz <web_AT_apgwoz.com> wrote:
> On Wed, Dec 11, 2013 at 1:14 PM, Patrick <201009-suckless_AT_haller.ws> wrote:
>> On 2013-12-11 12:21, Andrew Gwozdziewycz wrote:
>>> Yes. You can do exactly that. But you *can't* do:
>
> Sorry, I shouldn't have said *can't*, since I knew it was *possible.*
>
>>> when -t "ssh user_AT_host" "xmessage 'Connected'"
>>
>> Time to rock the IPC?
>>
>> #!/bin/bash
>> MAGIC=5
>>
>> system_time_epoch() { date +%s; }
>> file_time_mod() { stat --printf='%Y' $1 ; }
>> file_age() { echo $(( $(system_time_epoch) - $(file_time_mod "$1") )); }
>>
>> tmp="/tmp/michael_jackson_touched_my_$$"
>> touch $tmp
>>
>> (
>> while test $( file_age $tmp) -lt $MAGIC; do sleep 1; done
>> xmessage "wtf? you let him touch your $$"
>> ) &
>>
>> while ! ssh $there ; do
>> touch $tmp
>> done
>
>
> However, look at that. It's not exactly something you're going to do
> just one off.
>
>
>
> --
> http://apgwoz.com
>
Received on Wed Dec 11 2013 - 19:25:32 CET

This archive was generated by hypermail 2.3.0 : Wed Dec 11 2013 - 19:36:06 CET