Hi Jin, I tried the script recently with the same result, so I went back to my original "donation" and simplified it a bit more. I used it recently on about 30 datasets and it works well. Usage: rotbvecs <original bvecs> <rotated bvecs> <ecclog> [-k] <ecclog> the output log file from ecc -k keep the mat files It's attached. Best, Martin On Friday 23 April 2010 22:53:56 you wrote: > Hello, > > I run into the following error when running rotate_bvecs (FSL 4.1.5): > > syntax error near unexpected token `done' > line 21: `done' >