Hi all,
I am new to Linux/shell scripting having moderate knowledge.
In my script, I need to get execution time of a command (say 'ls') in mili seconds level. For this i tried using "time" command to retrieve the total execution time in milli seconds. But, the problem is that, how to save the output of time command in a variable. The format of the command is like "time ls -R /opt"
Going further, the o/p of 'time' command is
Ex
real 0m0.003s
user 0m0.004s
sys 0m0.000s
Here, in my script, I would like to use only middle line "
user 0m0.004s" saved to the variable but unable to find out the way.
Can someone help me out with this issue. Thanks a lot.