我正在尝试将gjb2菜单中同名$ {id} .txt的所有文件合并到一个文件(out.txt)中并遇到问题:
gjb2() {
printf "\n\n"
printf "What is the id of the patient getting GJB2 analysis : "; read id
printf "Enter variant(s): "; IFS="," read -a variant
[ -z "$id" ] && printf "\n No ID supplied. Leaving match function." && sleep 2 && return
[ "$id" = "end" ] && printf "\n Leaving match function." && sleep 2 && return
for ((i=0; i<${#variant[@]}; i++))
do printf "NM_004004.5:%s\n" ${variant[$i]} >> c:/Users/cmccabe/Desktop/Python27/$id.txt
done
add2text ${id}.txt
add2out
gjb2name
}
要合并的命令:
add2out() {
cd 'C:\Users\cmccabe\Desktop\annovar'
printf "NM_004004.5:%s\n" ${variant[$i]} > C:/Users/cmccabe/Desktop/annovar/out.txt >> out.txt
}
谢谢你:)。