Brain imaging & Unix command/command

for command and if command

Re-Happy-Doc 2016. 9. 13. 20:22

for 변수 in 단어 목록

do 

명령

done 



#! /bin/bash <항상 시작은 #! /bin/bash로 시작하며, 이것이 sh 명령문의 시작임> 

 

for s in `cat $h/Duloxetine/allsubject.txt`<`back quate 는 표준 출력에서 치환해야 하는 명령의 경계임>

do

  if [ -e $h/Duloxetine/$s/dmri/dtifit_FA.nii.gz ]; then

  echo $s >> $h/analysis/tbss/du/subjectlist.txt

  cp $h/Duloxetine/$s/dmri/dtifit_FA.nii.gz $h/analysis/tbss/du/FA_${s}.nii.gz

  fi

 

done

 

for s in `cat $h/Pristiq/allsubject.txt`

do

  if [ -e $h/Pristiq/$s/dmri/dtifit_FA.nii.gz ]; then

  echo $s >> $h/analysis/tbss/pr/subjectlist.txt

  cp $h/Pristiq/$s/dmri/dtifit_FA.nii.gz $h/analysis/tbss/pr/FA_${s}.nii.gz

  fi

done



'Brain imaging & Unix command > command' 카테고리의 다른 글

linux tips and shell script homepage  (0) 2016.09.28
Path 설정  (0) 2016.09.27
Install lesstif on Mac OSX  (0) 2016.09.22
처음으로 만든 Shell script   (0) 2016.09.15
리눅스 명령어 site   (0) 2016.09.15