On 2013-12-11 12:21, Andrew Gwozdziewycz wrote: > Yes. You can do exactly that. But you *can't* do: > 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