bash - How do you specify a file's name as part of the input directory? -


i have files in 1 directory format

- 0163-301_02_29_2008_off.nii - 0163-301_02_29_2008_on.nii - 0164-303_11_30_2007_off.nii - 0164-303_11_30_2007_on.nii 

i run command involves names of files inputs. address path be

/users/jjuan/documents/mtautism/new_mtr_datasets/usablenii/0163-301_02_29_2008_off.nii

and on.

so far, i've code i've written

for file in *_on.nii;  set fileroot = ${file} cut -b 1-78 echo $fileroot  /usr/local/fsl414/bin/flirt -in $file  -ref /users/jjuan/documents/mtautism/new_mtr_datasets/usablenii/$fileroot_off.nii -out /users/jjuan/documents/mtautism/new_mtr_datasets/usablenii/$fileroot_ontooff -omat /users/jjuan/documents/mtautism/new_mtr_datasets/usablenii/$fileroot_ontooff.mat -bins 256 -cost corratio -searchrx -90 90 -searchry -90 90 -searchrz -90 90 -dof 6  -interp trilinear  done 

however, $fileroot set doesn't appear in path specified, , ouputs blank space.

fix variable naming, starters:

for files in *_on.nii;     ^^^^^- files s  set fileroot = ${file} cut -b 1-78                  ^^^^-- -file without s 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -