it doesn't follow the workflow.
The goal of this program is to be called from a data processing shell script. It is provides a contiguous range of usable unique ids.
So:
#1 - Check for input files.
#2 - Count input files - "wc -l" or some such
#3 - Call get_id_range, telling it how many you need
#4 - get_id_range figures out last highest used, and lets you know what the next available range is, in $LOW and $HIGH. It writes the highest in the file for the next invocation. It keeps the file locked during the process to make sure a simultaneous run does not hurt it. The lock is nothing more than the same file name with .lck added. This allows network mounted files to work when there is not a lock manager avaiable for real locking.
#5 - cat *.dat | preprend_id $LOW $HI >new_data_file_with_sequences.dat
#6 - Profit!