hey manas,
I didn't understand why the while loop is required?
I tried the following way. It isn't giving any error but no outputs also
x=`nawk -F 'NR == 1 {print $1}' | sed 's/^.*(\(.*\))/\1/'`
echo "$x"
The nawk part is working. I have checked it with echo command. So the input to
sed is something like
name(abc).
Can you please clarify where I am going wrong?