I'm writing SML programs, and I'd like a way to quickly see the output from running a program in the REPL without actually running the REPL (to quickly see if a program has syntax errors - I plan to use this as a make program for .sml files in vim to view the output inside vim).. Currently, I have this:
sml file.sml | echo -e "\004"
So it runs the program, and then echoes Ctrl-D to exit the REPL. The problem is that its too quick to send the Ctrl-D key, so there is no output. I tried this too:
sml file.sml | sleep 2 ; echo -e "\004"
But that isn't doing it either. Any ideas on how I can get a dump of the output from the REPL?