RudraB |
07-04-2008 12:01 AM |
sed help with variable
i have a script:
Quote:
for (( i=1;i<=9;i++ ))
do
j=`expr 10 - $i`
mkdirhier Dir/Mn${i}Cr${j}
cp FFILES/param.h Dir/Mn${i}Cr${j}
rho=`echo "scale=1; $i/10" | bc`
echo $rho
sed -e '6c\ parameter(nsite=369902,x=${i},y=1-x,nkp=17,maxrec=12)' Dir/Mn1Cr9/param.h>tmp$i
cp tmp$i Dir/Mn1Cr9/param.h
done
|
the problem is with sed line....i expect sed to replace x=${i}, where i is variable; but sed is just prompting ${i}; not the current value of $i:cry: ...any help?
|