Problems with one line output

my echo $var1 gives below value

1.7_NEW=25,1.7_RETAINED=30,1.7_RETURNING=40

[/CODE]

i want it in 3 different values....

i.e. as

echo $1.7_NEW=25
echo $1.7_RETAINED=30
echo $1.7_RETURNING=40

[/CODE]

the o/p of $1.7_NEW should be 25.....

You cannot assign variables named with numbers
i.e.;

a=somevalue
1.7_NEW=25  # this will generate an error. 

So, could you show us what your input data looks like, so we can help you get output?

hi jim

I did try the same.... but i did get error...
so i taut of asking help from this forum...

m getting this var1 value from DB with a simple select query....

What are you about to perform with these variables ?

echo "$var1" |  awk -F[,=] '{print $2, $4, $6 } ' 

Start with that, and if you were to explain what you need rather than what you did, we could help more.

Hi Nikhil,

I am assuming this this varibale is coming from a script, where you are trying to fetch data from a database. In case you ment to see the variables in different lines rather online We can use 'tr' command, hope this helps.

[Rob@mytestmachine~]# echo $var1|tr '[,]' '[\n]'
1.7_NEW=25
1.7_RETAINED=30
1.7_RETURNING=40