#!/bin/bash #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # (C) 2003 by Hannu E K Nevalainen, Mariefred, Sweden # Written 2003-09-30. # Free to use under any circumstances. # Requires the "cygwin" Unix-on-windows emulation. # # This will launch a "SYSTEM" owned bash-prompt in a console window # at next even minute boundary, according to the windows "clock". # -NO- options available. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if [ -z "`which at`" ] ;then echo -e "\nCan't locate the wind-dos \"at.exe\" command." echo "At this writing it is unknown whether it exists in Win9x." echo -e "\n\e[41m SCRIPT TESTING HAS BEEN DONE UNDER Win2K, SP4+ ONLY \e[m\a\n" exit 1 fi # Build the WINDOWS command line to execute #------------------------------------------ # NOTE: Windows paths DOESN'T need backslash escape conversion! c="`which bash`" c="`cygpath -aw $c` --login -i" c="cmd /c \"$c\"" # Launch it at NEXT while minute... #---------------------------------- # find out current HH:MM -> h m h=`date +%H` m=`date +%M` # Increase m one step (possibly flipping the hour) if [ $m -gt 58 ] ;then m='0' h=$(( ( $h + 1 ) % 24 )) else m=$(( $m + 1 )) fi # Right adjust and zero fill h="00$h" h=${h: -2} m="00$m" m=${m: -2} # Initiate launch, assuming "at" is in the PATH #---------------------------------------------- at $h:$m /interactive $c # Display result #--------------- at echo "at id-number /delete # <- this will remove a badly set job"