Bwrite
From Scriptwiki
The bwrite command is used to write data to a file.
bwrite <filename> <S> [N] <text|%var|&binvar>
This will write N bytes from the specified text / %var / &binvar data to the file, starting at position S. This will overwrite existing data, if any. If the file doesn't exist, it will be created. If the file is smaller then S bytes, it will be extended with zeros to the Sth byte.
If S = -1 the data will be appended to the end of the file.
If N = -1 all of the specified data is written to the file.