Ask a Question

How can context switch time be reduced ?

on 2011-09-18 17:16:45   by DILIP   on Computer Science & Engineering  1 answers

rituparna

on 2011-09-30 09:30:00  

Sometimes, simple shell scripts can save a lot of time. Recently, I noticed myself waiting for various unit tests to complete by surfing the web: a surefire way to be distracted for more than the time it takes for the tests to complete (or fail). Enter the following script, which I call notify: #!/bin/sh \"$@\" status=$? xmessage -center \"$(basename $1) done, status $status\" exit $status You run it like this: notify make all at which point make runs along merrily. Of course, you replace make with whatever command you run that takes a long time to complete. When make exits, a small window appears in the middle of your screen that says “make done, status 0″. This immediately notifies you to stop surfing and get back to work. So… get back to work!