Just a little update to my script - can now put filenames straight from the
array to the top of each file with a neat single blank line.
echo "$i" >> $compilation_file ; y
Code:
#!bin/bash
y() { echo -e "\n" >> $compilation_file; }
z() { echo -e "\n\n" >> $compilation_file; }
echo - "Please type the path to the compilation file :"
read compilation_file
echo "Please type the original files that are going to make up the compilation file :"
read -a original_files
for i in ${original_files[*]}
do
echo "$i" >> $compilation_file ; y
cat $i >> $compilation_file ; z
done