triffid / FiveD_on_Arduino

Rewrite of reprap mendel firmware
http://forums.reprap.org/read.php?147,33082
GNU General Public License v2.0
30 stars 12 forks source link

Enhancements to func.sh. Idiot proofed mendel_talk and added some comments. #23

Closed jgilmore closed 13 years ago

jgilmore commented 13 years ago

I found that even though I know perfectly well to terminate mendel_talk with ^D, my fingers don't always remember, and then I forget why mendel_cmd isn't working and waste time.

So I fixed it to check for "cat" processes started from this terminal before and after, and if there aren't any before and are after, kill it! (sorry, hard sentance to parse, code is easier)

This way it doesn't matter if I forget and hit ^C instead, unless I already have a job running with a "cat" process in it. Which is unlikely, but at least this code won't screw up already running processes.

In theory, I suppose that I could make it check, store the list, and compare. But that's way to much effort for a corner case. I mean, I almost didn't even bother to check for previously running "cat" processes.

Also added a few comments.

triffid commented 13 years ago

thanks, pushed. I also added a quick message "press ctrl+D to exit" :)