shell scripting
Hi,
i plan to run a program over some 20 files were i need to input
one files as REFERENCE and then the remaining as TEST. i have return
a script to take every file in the list to be taken a REF and the
remaining as TEST and it works well{all with all }. but i want to
specify which one to be taken as reference so it wil reduce my output
time and space . pls help me out to rite a script. the lists of 20
files is in "list1" and the program is align.exe. "test.cor and
test.show" are the output files.
----------------------
#!/bin/sh
sed 's/.pdb//' list1 > temp_list1
total_files=`awk 'END {print NR}' list1`
echo "1" > temp1
echo "yes" >> temp1
echo "" > temp3
echo "" > temp5
echo "n" >> temp5
echo "auto" >> temp5
echo "test.cor" >> temp5
echo "test.show" >> temp5
count1=1
while [ $count1 -lt $total_files ]; do
echo "count1=$count1"
file_ref=`sed -n ''$count1'p' list1`
new_ref=`sed -n ''$count1'p' temp_list1`
echo $file_ref > temp2
count2=`expr $count1 + 1`
while [ $count2 -le $total_files ]; do
echo "count2=$count2"
file_work=`sed -n ''$count2'p' list1`
new_work=`sed -n ''$count2'p' temp_list1`
echo $file_work > temp4
cat temp1 temp2 temp3 temp4 temp5 > align.in
./align.exe < align.in
mv test.cor ${new_work}_${new_ref}.cor
mv test.show ${new_work}_${new_ref}.show
count2=`expr $count2 + 1`
done
count1=`expr $count1 + 1`
done
rm -f temp? temp_list1
--------------------------------------------
Reply to: