[nylug-talk] capturing dd time to variable in bash

jh jhlists at hirschman.net
Mon Apr 16 17:51:46 EDT 2007


I'm trying to grab some output from the time command, which is prefacing 
a dd command.

This:

TIMEFORMAT=$'%3R'
time dd if=/dev/urandom bs=1024 count=${bytes} of=$testdir/${count}.xxx 
 > /dev/null 2>&1

works great for standard output:

0.021


How can I grab this into a variable? Nothing I've tried works :(


Thanks.

jh


More information about the nylug-talk mailing list