There's No Such Thing As Software Productivity
Arduino Controlled RC Car

The Simplest Continuous Testing

Here's a simple bash script I use to do things to files whenever they change. It takes a command as an argument and runs that command with the name of a changed file. Many times, it's all I need to do continuous testing.


#!/bin/bash
# Requires that the inotify-tools package be installed.
wait_cmd="inotifywait -m -r --format %w%f -e modify ."
filter=$1
shift
cmd="$@"
$wait_cmd | grep --line-buffered $filter | while read file; do 
  clear
  $cmd $file
  date
done

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

The comments to this entry are closed.