I'm guessing you'd get the same errors if you ran these commands manually in this order one after other (i.e., you pasted them into the CLI). This might just be a limitation of the file system. What you might do is conver this to Tcl so you don't need to use the CLI to store the output (or at least open the file once).
You can use the tool at http://www.marcuscom.com/convert_applet/ to convert your applet to Tcl. A simple modification would then be to remove the append bits, and store the $_cli_result into an accumulator buffer. At the end, do the email of that buffer.
We are pleased to announce availability of Beta software for 16.6.3. 16.6.3 will be the second rebuild on the 16.6 release train targeted towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are looking for early feedback from custome...