From: Christian Neukirchen Date: 2006-08-16T19:38:33+09:00 Subject: Re: building a log by watching a file Bil Kleb writes: > I've been paying attention to some mind-numbing chores > I've been tasked to do lately, and I think Ruby might > be able to help. Let me know what you think. > > We have *many* crusty Fortran (and FORTRAN) codes lying > around that do their job just fine, except they are > a pain to run. > > One scenario might go like this, > > $ ./code < input_deck > [edit a bunch of things in input_deck] > > This two step is repeated ad nauseam until you're satisfied > with the output. The kicker is you do this once to find > the path to the solution, then you run 3,000 variations > on this central theme. > > One burden is logging your sequence of input_deck > edits, so that you can replay them for the > next 3000 cases (adding logging to the crusty code > is unthinkable). > > So, I was thinking of turning on a "watcher" that > would save off inputs decks every time an edit is > detected. > > Anyone have a one-liner? What I'd do: while true; do git commit -m "$(date)" input_deck; sleep 1; done Ought to work with any reasonable VCS. > Thanks, -- Christian Neukirchen http://chneukirchen.org