OK, this is what I'm trying to do :
- Execute a command, and time it at the same time (using
time
) - Get its output
- Get time elapsed
That's my code so far :
for filepath in $files
do
(
output=$(time $filepath &>1)
echo ${output}
)
done
However, every command still outputs its time to screen, and $output
contains the command's output.
Any ideas how to get both of them?