expr error in ksh

Hi ALL,

i am so much confused y the following script is not working in the korn shel which works in bash shell. please solve the error that i am facing.

i want to extract the format of the size from a variable i.e. GB or KB or MB or B or BYTES

code:
--------
size_dir_pass=1.2gb
size1=`expr $size_dir_pass | sed 's/[\.0-9]//g'`
echo "size1" $size1

size1 value is not printing ... please help me ...

Error :
Usage : expr expression

Thanks in advance
kamal

I am not facing any problem in Korn shell

> size_dir_pass=1.2gb
> size1=`expr $size_dir_pass | sed 's/[\.0-9]//g'`
> echo "size1" $size1
size1 gb
> echo $SHELL
/bin/ksh

I don't see why "expr" is there at all; and it won't understand suffixes.

$ size_dir_pass=1.2gb
$ size1=${size_dir_pass##*[0-9.]}
$ echo $size1
gb