4cade/bin/addfile.sh
2021-11-12 20:46:05 -05:00

20 lines
375 B
Bash
Executable File

#!/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"