awk

Hi All,

i want to excute this in a shell script

awk -F"," 'NR == $i {print S1}' $file_name

and assign the return to variable x

the problem is how to compile the $i while it is between single qutations?

thanx

i reach to this for now

echo awk -F'","' "'"NR == "$i"{print \$1}"'" $file|sh

but there still missing part in how to assign this to variable x

try this

x=`echo awk -F'","' "'"NR == "$i"{print '$1'}"'" $file|sh`

echo $x

regards