rotate commands listed in a file if file execution has been interrupted

Eon Works | Scripts | Demo | About | Links

img
script: rotcmd (download)
purpose: rotate commands listed in a file if file execution has been interrupted
requires: standard GNU commands
version: 1.0
usage: rotcmd [-hlm] <file>
options:
 

     <file>, file with the commands

     -h, usage and options (this help)

     -m, manual

     -l, see this script"

manual:
 



DESCRIPTION



    This script is useful in a situation when one has to regularly run

    multiple commands that are listed in a file and may have to stop the

    execution of the file before all commands are done executing. Upon

    next execution of the file, to avoid re-running the already run

    commands, one would have to manually re-arrange the commands.



    This script eliminates the need for that, as it acts as a wrapper to

    the commands listed in a file.



    If the execution of this script is interrupted, the commands stored in a

    file get rotated, so the commands which have already been executed will

    be appended to the end of the file. The only command that will be re

    executed is the one which did not finish running when the file execution

    was interrupted.



NOTE



    The last command in file must be terminated by a new line character.