Fixed a bug in msr2data which affected the msr-file generation if the fit template was equal to one of the target files

This commit is contained in:
Bastian M. Wojek 2009-05-20 18:42:38 +00:00
parent 19e8e180a9
commit c31c4c6c87

View File

@ -80,7 +80,8 @@ EOFHELP
else
export PATH=./:$PATH
PATH=./:$PATH
LC_NUMERIC=en_US.UTF-8
SUMMDIR="/mnt/data/nemu/summ"
@ -260,7 +261,7 @@ else
fi
# if it's the first run to be fitted, take the template and substitute the runnumber to match the first run
if [ "$q" -eq 0 ]; then
if [ "$q" -eq 0 ] && [ "$TEMPLATE" != "$FIRSTINPUT" ]; then
awk -v count=$TEMP -v nextcount=${RUNARRAY[0]} -v nextinput=$FIRSTINPUT '{
if(NR==1) print nextcount > nextinput
else if($1 == "RUN") {
@ -300,6 +301,7 @@ else
COUNTX=$COUNT
TEMPLATEX=$COUNT$EXTENSION.$OUTPUTEXT
fi
if [ "$TEMPLATEX" != "$NEXTINPUT" ]; then
awk -v count=$COUNTX -v nextcount=$NEXTCOUNT -v nextinput=$NEXTINPUT '{
if(NR==1) print nextcount > nextinput
else if($1 == "RUN") {
@ -317,6 +319,7 @@ else
}' $TEMPLATEX
fi
fi
fi
if [ ! -r $COUNT$EXTENSION.$OUTPUTEXT ]; then
echo
@ -420,6 +423,9 @@ else
# put together all data to db- or column-format and write it to the file
awk -v outfile=$OUTFILE -v noheader=$NOHEADER -v runList=$RUNLIST_USED -v numIndVar=$NUM_OF_IND_VAR -v format=$FORMAT '{
if(tolower(outfile) == "none")
exit 0
FS = " "
OFS = " "