time command usage in sh script

how do i get the following type of information when we have a time command in sh script.

0.01user 0.00system 1:32.98elapsed 0%CPU (0avgtext+0avgdata 5360maxresident)k
0inputs+0outputs (342major+0minor)pagefaults 0swaps

I always see the following for the time command
real 0m0.000s
user 0m0.000s
sys 0m0.000s

Pls help me solving this mystery output.

That looks like the output of time -p The -p option outputs the 'stderr' output version of time.

It could mean that "time" inside the script is an alias for time -p, for example.

The first version comes from an external time command (e.g., /usr/bin/time); the second is from your shell's built-in time command.

if i run time from
/usr/bin/time

then also i see the output as
real 0m0.000s
user 0m0.000s
sys 0m0.000s

Is there any new executable which i need to download to make it work?

Please post the exact command you use, and the exact result. Copy and paste, do not retype anything.

Also, take a look at what versions of time you could be accessing. If your shell is bash, use: type -a time.

sh-3.1$ type -a time
time is a shell keyword
time is /usr/bin/time
time is /bin/time

-------------------------------------
sh-3.1$ time

real 0m0.000s
user 0m0.000s
sys 0m0.000s
------------------------------------
sh-3.1$ which time
/usr/bin/time

sh-3.1$ /bin/time
Usage: /bin/time [-apvV] [-f format] [-o file] [--append] [--verbose]
[--portability] [--format=format] [--output=file] [--version]
[--help] command [arg...]

---------------------------------------------------

sh-3.1$ /usr/bin/time
Usage: /usr/bin/time [-apvV] [-f format] [-o file] [--append] [--verbose]
[--portability] [--format=format] [--output=file] [--version]
[--help] command [arg...]

It means your time command is part of the shell, an internal command. To use an external command you have to reference it:

/usr/bin/time -p <executable filename> should duplicate the first result you posted as an example.