Specify the full path to time
(the parentheses are unnecessary):
export TIME="%e"
/usr/bin/time -ao times.dat curl -v -d @1.batch -X POST $DB
Note that a different environment variable and a different specifier are used to obtain the elapsed time.
time
is a Bash keyword and doesn't support the options -a
or -o
.
/usr/bin/time
is an external binary which does.
$ type -a time
time is a shell keyword
time is /usr/bin/time
$ help time
time: time [-p] PIPELINE
Execute PIPELINE and print a summary of the real time, user CPU time,
and system CPU time spent executing PIPELINE when it terminates.
The return status is the return status of PIPELINE. The `-p' option
prints the timing summary in a slightly different format. This uses
the value of the TIMEFORMAT variable as the output format.
$ man time
TIME(1) TIME(1)
NAME
time - run programs and summarize system resource usage
SYNOPSIS
time [ -apqvV ] [ -f FORMAT ] [ -o FILE ]
[ --append ] [ --verbose ] [ --quiet ] [ --portability ]
[ --format=FORMAT ] [ --output=FILE ] [ --version ]
[ --help ] COMMAND [ ARGS ]
DESCRIPTION
time run the program COMMAND with any given arguments ARG.... When
COMMAND finishes, time displays information about resources used by
COMMAND (on the standard error output, by default). If COMMAND exits
with non-zero status, time displays a warning message and the exit sta‐
tus.
.
.
.