Problem with AWK

when i used to run this command

 A2=`cat temp |awk -F "," '{print $7}' | awk -F ";" '{print $1}'` 

give the requited O/P

but when i use this command in script its taking only

is there any problem in using this command in script or spaces are not readable in script

Hi,

i just can guess that you forgot to quote the variable while using it like that "$A2"

But we don't have the script so it's not easy to reply.

As an aside:

awk -F'[,;]' '{print $7}' infile

would accomplish the same thing..