Automate commands

This provides a way to capture specific shell commands to a file "shellcmds.sh".
LaTeX's support for writing to files is very limited, I don't think it can dynamically open files that way. I was talking about adding a comment to the file itself which includes the chapter name and linenumber.