Monthly Archive for December, 2009

Wait for process to terminate

One of my not-so-geek friends that practice couch-surfing in my living room was impressed with my ability to shut down my workstation after watching a movie. Here you have the recipe.

#!/bin/bash
if [ $1 = "" ]; then
 echo "Usage: $0 PROCESS_NAME"
 exit
fi
while pidof $1; do sleep 1; done

Assuming the script is called foo.sh:

$ ./foo.sh mplayer && shutdown

Computer mit Gedanken steuern on SF

The Swiss-German television SF shot a documentary at our lab! It was a pretty cool experience, and I have been driving the CNBI  BCI-controled wheelchair for good!