4cade/bin/addfile.sh

20 lines
375 B
Bash
Raw Normal View History

2021-11-13 01:46:05 +00:00
#!/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"