Skip to content

Instantly share code, notes, and snippets.

@wvl
Created January 10, 2011 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wvl/772751 to your computer and use it in GitHub Desktop.
Save wvl/772751 to your computer and use it in GitHub Desktop.
map reduce with redo: Prakhar
exec >&2
echo -n > diff
redo-ifchange $(find sources -name '*.dat')
for i in $(find sources -name '*.txt');do redo-ifchange ${i}.dat;done
cat diff
grep 'd .*' diff | cut -d ' ' -f 2 | sed -e 's/^/sources\//' | xargs rm
# sh do-reduce <diff
redo-always
if [ ! -e $1 ];then
echo -n > $3
echo d $1.dat >> ../diff
else
redo-ifchange $1
echo $1 >> ../diff
echo $(date) > $3
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment