On Wed, Dec 11, 2013 at 1:14 PM, Patrick <201009-suckl...@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@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