Created
December 31, 2019 17:42
-
-
Save mtholder/b81a63cdec5fc3a8f1cd9461beee4e20 to your computer and use it in GitHub Desktop.
script to populate a reversed_subproblems subdirectory in a synth tree build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| inpdir=$1 | |
| if ! test -d "${inpdir}" ; then | |
| echo "$0 must be passed in a directory of subproblems (with ott###.tre files)." | |
| exit 1 | |
| fi | |
| rpwd=`realpath .` | |
| rpid=`realpath $inpdir` | |
| if test "${rpwd}" = "${rpid}" ; then | |
| echo "$0 Cannot be run in place." | |
| exit 1 | |
| fi | |
| for i in `ls "${inpdir}"/ott*.tre` ; do | |
| bn=`basename "$i"` | |
| stem=`echo $bn | sed -E 's/.tre$//'` | |
| tnf="${inpdir}/${stem}-tree-names.txt" | |
| ./gen_reversed.py "${i}" > "${bn}" | |
| if test -f "${tnf}" ; then | |
| ./gen_reversed.py "${tnf}" > "${stem}-tree-names.txt" | |
| fi | |
| echo $stem | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment