I have the following command line:
time `while [ $i -lt 200000 ]; do i=$[$i+1]; done` | grep "real"
from what I know of bash this should first give me the run time of the while loop and use it as the input for the grep
command and then the grep
command should print out only the real time given by the time
command but instead it prints the full output of the time
command
so why is it not working as I would expect. also is there a better way to do this?