I\'m struggling to parse the output of the time command in bash - and even to stop it from printing out its output when I call it. This is my test code:
#!/b
The time
command outputs the timing information to STDERR, which you aren't capturing or redirecting. So at the time of the assignment, that information is printed out to your console, while the $TIME
variable gets the STDOUT of the command - which you redirected to /dev/null
, so it's blank.
Perhaps you should try to capture the STDERR of the command?