Skip to content

Instantly share code, notes, and snippets.

@alxndrkalinin
Created February 19, 2016 22:47
Show Gist options
  • Save alxndrkalinin/b5c5516a0144590f442c to your computer and use it in GitHub Desktop.
Save alxndrkalinin/b5c5516a0144590f442c to your computer and use it in GitHub Desktop.
collectOffFiles
#!/bin/bash
lines=1
while read -r line; do
loniresults="/Users/alex/Projects/AtheyLab/LONI_Results/ShapeTranslator_2.ShapeOutputDirectory-"
printf -v idx "%02d" $lines
currdir=$loniresults$idx
filename="/182_QEM_SubDiv.off"
target=$currdir$filename
destdir=${1%_c0.lst}
destdir=${destdir##*0}
newfilename=${line%.nii*}
newfilename="/$newfilename.off"
dest=$destdir$newfilename
cp $target $dest
((lines++))
done < $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment