I like learning and creating small scripts for bash, and now I have finally the first "serious" problem I would like to solve through a script.
Here is the situation: I have a folder containing 45 rtf files. I want to prepend to each of them the name of the file (and its creation date) and then glue them all together in a unique rtf file, respecting chronological order.
How can I do that? For the moment I have created the following script: for every rtf file in the folder, it creates a new file (.txt... it is so difficult to use rtf with bash!) and writes into it the name and the creation date of the original file.
for f in *.rtf; do touch $f"_info_file.txt" echo "File name:" $f >> $f"_info_file.txt"; printf "Date: " >> $f"_info_file.txt"; stat -f "%SB" "$f" >>$f"_info_file.txt"; done
(I guess this is very rough...) Now I would like to glue them together in chronological order but I am a bit lost... Any ideas? Can Automator be useful? Thanks.