Sorry, messed up on original pull request and messaging -- here is my original comment, few edits:
...
Two changes:
1: added triple backslash-n for newline in cat statement in callR function for escaping newline in bash script, otherwise did not work on bash in my mac. Please test to see if it works for other bash as well (like Linux), but it should. Not sure why it worked on bash in Linux, unless I've not kept up on escaping sequences.
2: Changed creation of OUT and ERR tempfiles. As currently made, would create a file, and then append either .png or .err to the FILENAME in the bash script, and then would write to the filenames with the new suffixes. But the mktemp command makes the un-suffixed files as well, and they never get cleaned up in the temp directory using the trap call. Appending the .png and .err suffix in the inner mktemp command call fixes that (again, tested on a Mac).
Sorry, messed up on original pull request and messaging -- here is my original comment, few edits: ... Two changes:
1: added triple backslash-n for newline in cat statement in callR function for escaping newline in bash script, otherwise did not work on bash in my mac. Please test to see if it works for other bash as well (like Linux), but it should. Not sure why it worked on bash in Linux, unless I've not kept up on escaping sequences.
2: Changed creation of OUT and ERR tempfiles. As currently made, would create a file, and then append either .png or .err to the FILENAME in the bash script, and then would write to the filenames with the new suffixes. But the mktemp command makes the un-suffixed files as well, and they never get cleaned up in the temp directory using the
trap
call. Appending the .png and .err suffix in the inner mktemp command call fixes that (again, tested on a Mac).