Difference between

$x=10

and providing the spaces between = and 10

$x= 10

What shell are you using?

It's likely they are both wrong.

bash shell

---------- Post updated at 10:34 AM ---------- Previous update was at 10:31 AM ----------

actually when i am using
x=10 and echo "$x" output is 10

but in x= 10 no is not taking it why??

Because it's not the correct syntax.

BASH(1)                                                                                                        

NAME
       bash - GNU Bourne-Again SHell
...
A variable may be assigned to by a statement of the form

              name=[value]
...

There should be no spaces either side of =. x=" 10" would be OK, as assignments go.

thanx scottn