Editing
Manual
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===How to reproduce whole books=== The [http://sourceforge.net/mailarchive/forum.php?thread_name=20061222142849.9688.qmail%40web34215.mail.mud.yahoo.com&forum_name=rsf-user 2006-12-22 rsf-user thread], [http://reproducibility.org/rsflog/index.php?/archives/142-Assembling-reports-from-papers.html the 2007-04-08 blog entry] and more. From Jim's 2009-03-7 rsf-devel message: Here is a way to generate all the targets in the subdirectories of $RSFSRC/book/geostats/spatial_stats: <syntaxhighlight lang="bash"> cd $RSFSRC/book/geostats/spatial_stats sftour scons </syntaxhighlight> That works pretty nice. It generates all the targets in each of the 4 subdirectories of book/geostats/spatial_stats. Now suppose I want to capture the output and errors in a log file (tcsh): <syntaxhighlight lang="bash"> sftour scons >& scons.log </syntaxhighlight> That's nice, except all the output goes into one log file in book/geostats/spatial_stats. Suppose I want 4 separate log files, one in each of the subdirectories. This will do the trick: <syntaxhighlight lang="bash"> sftour 'scons >& scons.log' </syntaxhighlight> The quotes make the entire string go to sftour as the command to run in each directory, instead of just 'scons'. So far so good. Now suppose I want to go up one directory level and do the process recursively: <syntaxhighlight lang="bash"> cd $RSFSRC/book/geostats sftour sftour 'scons >& scons.log' </syntaxhighlight> Well, that runs scons in each of the book/geostats/*/* directories, but it only makes 3 log files in the 3 subdirectories of book/geostats, not 14 log files in the 14 book/geostats/*/* directories. I can get 14 separate log files like this: <syntaxhighlight lang="bash"> sftour "sftour 'scons >& scons.log'" </syntaxhighlight> That does what I want. Now suppose I want to go up one more level to $RSFSRC/book and run the process recursively three levels deep: <syntaxhighlight lang="bash"> sftour sftour "sftour 'scons >& scons.log'" </syntaxhighlight> This works, but it doesn't put the log files in the bottom level, it puts them one level up. I can't fix it the same way I did before because I've run out of quotes :-) Here is one way to do it (tcsh): <pre> foreach i (*) if ( -d $i) then echo ++++++ $i cd $i sftour "sftour '/usr/bin/time -p scons >& scons.log'" cd .. endif end </pre> From Sergey's 2009-03-10 rsf-devel message: A more elegant solution is <syntaxhighlight lang="bash"> sftour sftour scons >& ../../%/%/scons.log </syntaxhighlight>
Summary:
Please note that all contributions to Madagascar are considered to be released under the GNU Free Documentation License 1.3 or later (see
My wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Getting Madagascar
download
Installation
GitHub repository
SEGTeX
Introduction
Package overview
Tutorial
Hands-on tour
Reproducible documents
Hall of Fame
User Documentation
List of programs
Common programs
Popular programs
The RSF file format
Reproducibility with SCons
Developer documentation
Adding programs
Contributing programs
API demo: clipping data
API demo: explicit finite differences
Community
Conferences
User mailing list
Developer mailing list
GitHub organization
LinkedIn group
Development blog
Twitter
Slack
Tools
What links here
Related changes
Special pages
Page information