We are trying to run this Script:
#!/bin/bash
CrntDir=$(pwd)
cd $CrntDir
i=0
while read p; do
i=$((i+1))
echo $i
ReactionNr=$(awk 'FNR == i {print $1}' $CrntDir/allCcurv.dat)
echo $ReactionNr
# RLabel=$(grep -r '$ReactionNr' $CrntDir/newfile | awk '{print $2}')
#echo $RLabel
# awk '{print $0 $RLabel}' $CrntDir/allCcurv.dat
done <allCcurv.dat
so that it takes the value in the first column at the ith row and saves it in the variable ReactionNr. Then it should take that var and read a string that starts with that variable and in the end append that string to the first file. The Context is, that we need to sort some values from our experiements.
In this state the code just counts from i = 1 to i = #ofrows.
What are we doing wrong? And is the Expression FNR == i the right way to do what we want? (Found it somewhere in a Forum)
Thanks