expr only does integers, which the man pages in Linux sadly omits.
Solaris explicitly says it in the man page that it's only for
integers.

go for bc if you want remainders:

$ echo 5 / 3 | bc -l
1.66666666666666666666

-- 
regards,
Andre | http://www.varon.ca

On Nov 30, 2007 8:49 PM, Nelson Serafica <[EMAIL PROTECTED]> wrote:
>
>
> I'm trying to create a script that will convert b/s to kb/s. To convert to
> kb/s, I must divide it to 1000 b/s. However, the answer does not contain the
> remainder. When I do "expr 5 / 3", it shows only 1 (suppose to be 1.6).
> Doesn't show the remainder .6.
>
> I search in Google and it says the "%" is remainder of a division. But when
> I do expr 5 % 3, it shows "2". It suppose to be 6, am I right?
>
>
> Any inputs,
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to