so I've made a shell script that downloads 6 files in succession from a given url, then deletes them. Now I want to time the script, and the average time it uses by running it ~100 times. My problem is tho, how do I store the time it takes for each run through of the script? I know time writes to standard error, but I'm a total noob when it comes to shell scripting so I couldn't get it to work.
from what I gathered I can use
prog 2>&1
to send it stderr to stdout, but how do I now use the value I want?
what I get when I run my timer is 0.00user 0.01system 0:00.35elapsed and a lot of useless info (at least to me, only interested in elapsed time)
I only want the elapsed time so I can calculate on it later, and I need to send it into a variable so that I can add up 100 runs of the script.
Anyone with a decent clue got any pointers to send me in the right direction?