#!/bin/bash # parameters # 1 - input file # 2 - output filename for data file # stdout - source code of index record touch "$2" size=$(wc -c < "$1") offset=$(wc -c < "$2") cat "$1" >> "$2" echo ";" echo "; Index record for $1" echo ";" echo "; This file is automatically generated" echo ";" echo " !byte 0" echo " !be24 $offset" echo " !le16 $size"